Reverse urlresolver raises obscure exceptions on failure
|Reported by:||abrahamson.j@…||Owned by:||nobody|
|Severity:||Normal||Keywords:||reverse urls exception 'unbalanced parenthesis'|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Related to ticket #2977.
When reverse fails to reverse a complex regex obscure errors can be raised. For instance, reversing the url r'^(\d(\d)?)/$' causes an 'unbalanced parenthesis' to be raised from re.py._compile.
The urlresolver is clearly in flux right now; however, this error could be very difficult for someone new to Django (read, me) to understand. Better exception catching that notifies when a url isn't supported by reverse would be very helpful.
Change History (10)
Changed 7 years ago by guettli
comment:1 Changed 7 years ago by guettli
- Has patch set
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted