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 -- http://mail.python.org/mailman/listinfo/python-list