mirror of
https://github.com/python/cpython.git
synced 2025-08-18 07:41:05 +00:00
Merged revisions 79047 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79047 | senthil.kumaran | 2010-03-18 17:44:15 +0530 (Thu, 18 Mar 2010) | 3 lines Fix for Issue8135 - urllib.unquote to support mixed percent escapes ........
This commit is contained in:
parent
6044655d59
commit
34f9277d56
3 changed files with 31 additions and 4 deletions
|
@ -272,8 +272,9 @@ def urldefrag(url):
|
|||
# Cannot use directly from urllib as it would create circular reference.
|
||||
# urllib uses urlparse methods ( urljoin)
|
||||
|
||||
_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'."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue