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

Antoine Pitrou solipsis at pitrou.net
Tue Sep 30 11:06:52 CEST 2008


Le lundi 29 septembre 2008 à 17:50 -0600, Adam Olsen a écrit :
> It's correct in the sense that it can roundtrip all filenames.  UTF-8b
> is lossy, so certain filenames are not roundtripped properly.

Why do you say UTF-8b is lossy? From what I've read it claims to be
lossless (i.e. the range of characters used for escaping of invalid
bytes are themselves escaped if they are encountered in the source
sequence).

> As a user, I expect all file names to be printable.  That requires
> unicode, and any program that creates filenames with arbitrary
> bytestrings is just broken.

But if you use iso-8859-1 for decoding, all non-ASCII filenames will be
printed wrongly, not only those with invalid bytestrings. I fail to see
what it brings.





More information about the Python-3000 mailing list