Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8741 closed (fixed)

backwards-incompatible: urlresolvers.reverse no longer silently accepts unused args

Reported by: Carl Meyer Owned by: Malcolm Tredinnick
Component: Uncategorized Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Pre-[8760], urlresolvers.reverse would silently accept "extra" args and return a matched URL that didn't need the arg. Post-[8760], all args must be matched in the URL pattern.

The newer behavior is probably more correct, but this is a backwards-incompatible change for anyone who was relying on the prior behavior.

If the correct thing here is to document this on the BackwardsIncompatibleChanges page, I'm happy to do so - just checking to be sure this isn't a bug, since the [8760] rewrite was advertised as "fully backwards-compatible."

Change History (4)

comment:1 by Julien Phalip, 16 years ago

milestone: 1.0

Marking 1.0 just to make sure it doesn't get unnoticed.

comment:2 by Malcolm Tredinnick, 16 years ago

Owner: changed from nobody to Malcolm Tredinnick
Status: newassigned

I can probably fix this, at least for keyword arguments, so that extra arguments are permitted. Won't be possible for positional arguments, though. I'll have a look at it.

comment:3 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: assignedclosed

On second thoughts, it's a bad idea to allow this (which is a shame, because it's a three line change). It means that the first match (often the one requiring the least number of arguments) will work, not the one that exactly matches. Which means optional arguments will be omitted and that's bad. I'll update the backwards-incompatible changes page (you can't do it, since we made it read-only a while back after some vandalism).

comment:4 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top