[Python-Dev] bytes / unicode

P.J. Eby pje at telecommunity.com
Mon Jun 21 03:33:55 CEST 2010


At 07:33 PM 6/20/2010 -0400, Terry Reedy wrote:
>Do you have in mind any tools that could and should operate on both, 
>but do not?

 From http://mail.python.org/pipermail/web-sig/2009-September/004105.html :

"""The problem which arises is that unquoting of URLs in Python 3.X
stdlib can only be done on unicode strings. If though a string
contains non UTF-8 encoded characters it can fail."""

I don't have any direct experience with the specific issue 
demonstrated in that post, but in the context of the discussion as a 
whole, I understood the overall issue as "if you pass bytes to 
certain stdlib functions, you might get back unicode, an explicit 
error, or (at least in the case shown above) something that's just 
plain wrong."



More information about the Python-Dev mailing list