[issue3300] urllib.quote and unquote - Unicode issues

Antoine Pitrou report at bugs.python.org
Wed Aug 6 20:39:43 CEST 2008


Antoine Pitrou <pitrou at free.fr> added the comment:

Bill, I haven't studied your patch in detail but a few comments:
- it would be nice to have more unit tests, especially for the various
bytes/unicode possibilities, and perhaps also roundtripping (Matt's
patch has a lot of tests)
- quote_as_bytes() should return a bytes object, not a bytearray
- using the "%02X" format looks clearer to me than going through the
_hextable lookup table...
- when the argument is of the wrong type, quote_as_bytes() should raise
a TypeError rather than a ValueError
- why is quote_as_string() hardwired to utf8 while unquote_as_string()
provides a charset parameter? wouldn't it be better for them to be
consistent with each other?

----------
nosy: +pitrou

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


More information about the Python-bugs-list mailing list