Opened 16 years ago

Last modified 16 years ago

#6934 closed

django.core.urlresolvers.reverse fails sometimes. — at Version 1

Reported by: Sebastian Noack Owned by: Malcolm Tredinnick
Component: Core (Other) Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Malcolm Tredinnick)

If you have a url pattern, containing...

  • nested groups
  • not-matching groups
  • look-ahead or look-behind groups

...django.core.urlresolvers.reverse will fail, because of following reasons:

  • To replace the groups re.sub with r'\(([^)]+)\)' is used, which matches only until the first ')', doesn't matter how much groups are nested.
  • All groups which are no named groups are assumed to be positional groups, regardless if they might be not-matching, look-ahead or look-behind groups.

Change History (2)

comment:1 by Malcolm Tredinnick, 16 years ago

Description: modified (diff)
Owner: changed from nobody to Malcolm Tredinnick
Patch needs improvement: set
Summary: [PATCH] django.core.urlresolvers.reverse fails sometimes.django.core.urlresolvers.reverse fails sometimes.
Triage Stage: UnreviewedAccepted

This is a dupe of #2977, amongst others. But I'll leave it open because the patch is an interesting approach. I really need to finish fixing this, so maybe this will get me motivated.

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