[Python-3000] [Python-Dev] Filename as byte string in python 2.6 or 3.0?

Antoine Pitrou solipsis at pitrou.net
Mon Sep 29 13:12:43 CEST 2008


Adam Olsen <rhamph <at> gmail.com> writes:
> 
> UTF-8b doesn't work as intended.  It produces an invalid unicode
> object (garbage surrogates) that cannot be used with external APIs or
> libraries that require unicode.

At least it works with all Python operations supported by the unicode type
(methods, concatenation, etc.) without any bad surprise. That feeding it to e.g.
PyGTK may give bogus results is another problem.

> If you don't need unicode then your
> code should state so explicitly, and 8859-1 is ideal there.

But then you can say bye-bye to proper representation (e.g. using print()) of
even valid filenames.





More information about the Python-3000 mailing list