LANG, locale, unicode, setup.py and Debian packaging

Neil Hodgson nyamatongwe+thunder at gmail.com
Mon Jan 14 18:58:05 EST 2008


Martin v. Löwis:

> That's not true. Try open("\xff","w"), then try interpreting the file
> name as UTF-8. Some byte strings are not meaningful UTF-8, hence that
> approach cannot work.

    Has it been decided how Python 3.0 will implement os.listdir on 
Unix? Will there be only a single attempt to encode using the current 
locale or will there be a backup technique? I'd probably define an 
optional encoding parameter so you can ask for 
os.listdir(encoding="iso-8859-1") although that then propagates into 
open, ...

    Neil



More information about the Python-list mailing list