[issue1712522] urllib.quote throws exception on Unicode URL

STINNER Victor report at bugs.python.org
Thu Feb 12 23:14:03 CET 2009


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

quote() works in Python3 with any bytes string (not only ASCII) and 
any unicode string:

Python 3.1a0 (py3k:69105M, Feb  3 2009, 15:04:35)
>>> from urllib.parse import quote
>>> quote('é')
'%C3%A9'
>>> quote('\xe9')
'%C3%A9'
>>> quote('\xe9'.encode('utf-8'))
'%C3%A9'
>>> quote('\xe9'.encode('latin-1'))
'%E9'

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1712522>
_______________________________________


More information about the Python-bugs-list mailing list