summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-03-18 12:14:15 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-03-18 12:14:15 (GMT)
commitf3e9b2a996d9f18bf7060e0bff85c02bee47c490 (patch)
treef31606afa4463772a7591c526d90af64fe790e9c /Lib/urllib.py
parent43fe03a2062c8eb3b688a28cd9174a14a43eecf3 (diff)
downloadcpython-f3e9b2a996d9f18bf7060e0bff85c02bee47c490.zip
cpython-f3e9b2a996d9f18bf7060e0bff85c02bee47c490.tar.gz
cpython-f3e9b2a996d9f18bf7060e0bff85c02bee47c490.tar.bz2
Fix for Issue8135 - urllib.unquote to support mixed percent escapes
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 58e750a..c74dd3c 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -1158,8 +1158,8 @@ def splitvalue(attr):
if match: return match.group(1, 2)
return attr, None
-_hextochr = dict(('%02x' % i, chr(i)) for i in range(256))
-_hextochr.update(('%02X' % i, chr(i)) for i in range(256))
+_hexdig = '0123456789ABCDEFabcdef'
+_hextochr = dict((a+b, chr(int(a+b,16))) for a in _hexdig for b in _hexdig)
def unquote(s):
"""unquote('abc%20def') -> 'abc def'."""