Issue 8143: sync unquote in urlparse with urllib; add comment about doing so.

unquote is duplicated in the two files to avoid a circular reference.
(This is fixed in Python3.)  Updates keep getting made to the public unquote
without fixing the urlparse one, however, so this fix syncs the two
and adds a comment to both to make sure changes are applied to both.
This commit is contained in:
R. David Murray 2010-05-25 15:20:46 +00:00
parent b64c89bd7a
commit bfbdefe539
2 changed files with 18 additions and 10 deletions

View file

@ -1156,6 +1156,10 @@ def splitvalue(attr):
if match: return match.group(1, 2)
return attr, None
# urlparse contains a duplicate of this method to avoid a circular import. If
# you update this method, also update the copy in urlparse. This code
# duplication does not exist in Python3.
_hexdig = '0123456789ABCDEFabcdef'
_hextochr = dict((a + b, chr(int(a + b, 16)))
for a in _hexdig for b in _hexdig)