Opened 12 years ago
Closed 12 years ago
#22379 closed Bug (worksforme)
Escaping needed during lazy reversing of non-ascii URLs
| Reported by: | Jannis Vajen | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (URLs) | Version: | 1.6 |
| Severity: | Normal | 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
# urls.py
url(ur'^umläute_in_der_url/', include('my_app.urls')),
Reversing the above URL with non-ascii characters returns a properly percent-encoded string (i.e. 'uml%C3%A4ute_in_der_url').
But a problem occurs while passing the named URL to reverse_lazy because around line 164 in django.utils.functional.lazy.__mod__ a string formatting takes place which leads to a ValueError due to the unescaped percent-encoding.
ValueError: unsupported format character 'C' (0x43)
return bytes(self) % rhs
Note:
See TracTickets
for help on using tickets.
Hi,
I can't seem to be able to reproduce this:
Can you provide more information as to how you can trigger that error?
Thanks