[issue8135] urllib.unquote doesn't decode mixed-case percent escapes

2010-03-29 Thread Senthil Kumaran
Senthil Kumaran added the comment: merged into release26-maint as r79492. This issue can be closed. -- status: open -> closed ___ Python tracker ___ _

[issue8135] urllib.unquote doesn't decode mixed-case percent escapes

2010-03-18 Thread Senthil Kumaran
Senthil Kumaran added the comment: Fixed this in r79047. If we are to backport this to release26-maint, we need barry's approval. Barry, any thoughts? The change is a minor improvement, we have lived with normal case percent escape for long, mixed case would be bonus in release26. --

[issue8135] urllib.unquote doesn't decode mixed-case percent escapes

2010-03-15 Thread Matt Giuca
Matt Giuca added the comment: Thanks very much. Importantly, note that unquote is currently duplicated between urllib and urlparse. I have a bug on it (#8143) but in the meantime, you will have to commit this fix to both modules. -- ___ Python trac

[issue8135] urllib.unquote doesn't decode mixed-case percent escapes

2010-03-15 Thread Senthil Kumaran
Senthil Kumaran added the comment: I reviewed the patch: +_hexdig = '0123456789ABCDEFabcdef' +_hextochr = dict((a+b, chr(int(a+b,16))) for a in _hexdig for b in _hexdig) is really a neat way to generate the dict of mixed-case percent escape to use with to unquote. I shall commit the patch to

[issue8135] urllib.unquote doesn't decode mixed-case percent escapes

2010-03-14 Thread Matt Giuca
Matt Giuca added the comment: Tiny fix to patch2 -- replaced list comprehension with generator expression in dictionary construction. -- Added file: http://bugs.python.org/file16552/urllib-unquote-mixcase.patch2 ___ Python tracker

[issue8135] urllib.unquote doesn't decode mixed-case percent escapes

2010-03-14 Thread Matt Giuca
Changes by Matt Giuca : Removed file: http://bugs.python.org/file16551/urllib-unquote-mixcase.patch2 ___ Python tracker ___ ___ Python-bugs-lis

[issue8135] urllib.unquote doesn't decode mixed-case percent escapes

2010-03-14 Thread Matt Giuca
Matt Giuca added the comment: I thought more about it, and wrote a different patch which doesn't remove the dictionary. I just replaced the dictionary creation code -- now it includes keys for all combinations of upper and lower case (for two-letter hex codes). This dictionary isn't much bigg

[issue8135] urllib.unquote doesn't decode mixed-case percent escapes

2010-03-14 Thread Matt Giuca
Matt Giuca added the comment: Oh, I just discovered that urlparse contains a copy of unquote, which will also need to be patched. I've submitted a patch to remove the duplicate (#8143) -- if that is accepted first then there's no need to worry about it. -- ___

[issue8135] urllib.unquote doesn't decode mixed-case percent escapes

2010-03-14 Thread Matt Giuca
Matt Giuca added the comment: > Note: I've also backported the remainder of the 'unquote' test cases > from Python 3 but I found another bug, so I will report that separately, > with a patch. Filed under issue #8136. -- ___ Python tracker

[issue8135] urllib.unquote doesn't decode mixed-case percent escapes

2010-03-14 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti priority: -> normal stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue8135] urllib.unquote doesn't decode mixed-case percent escapes

2010-03-14 Thread Matt Giuca
New submission from Matt Giuca : urllib.unquote fails to decode a percent-escape with mixed case. To demonstrate: >>> unquote("%fc") '\xfc' >>> unquote("%FC") '\xfc' >>> unquote("%Fc") '%Fc' >>> unquote("%fC") '%fC' Expected behaviour: >>> unquote("%Fc") '\xfc' >>> unquote("%fC") '\xfc' I act