Hi, I'm working on ticket #13260 and looking for some advice. The ticket is about quoting of '%' in args and kwargs for urlresolvers.reverse(). Please ignore my initial patch as it's not quite right.
The reporter claims this is a bug: >>> reverse('myapp.views.download', args=['100% completed.png'] "/download/100%%20completed.png" and that output should be: "/download/100%25%20completed.png" My question is, is this expected behaviour, is a bug? If expected behavior -------------------- Currently, reverse assumes that the args and kwargs are correctly quoted for insertion into a URI. The iri_to_url() conversion does escape some disallowed characters, like space, but doesn't modify reserved delimiters like '#' --- it assumes you know what your are doing. If bug ------ Alternatively, if this is considered a bug, then urlquote should be applied to all items in args and kwargs for reverse. That would mean that this test is wrong though: >>> reverse('special', args=[r'+\$*']) '/special_chars/+%5C$*/' It would have to output: '/special_chars/%2B%5C%24%2A/' Cheers, Ben
signature.asc
Description: This is a digitally signed message part