urllib.unquote and unicode

George Sakkis george.sakkis at gmail.com
Mon Dec 18 21:57:38 EST 2006


The following snippet results in different outcome for (at least) the
last three major releases:

>>> import urllib
>>> urllib.unquote(u'%94')

# Python 2.3.4
u'%94'

# Python 2.4.2
UnicodeDecodeError: 'ascii' codec can't decode byte 0x94 in position 0:
ordinal not in range(128)

# Python 2.5
u'\x94'

Is the current version the "right" one or is this function supposed to
change every other week ?

George




More information about the Python-list mailing list