Comment Re:String f**k up (Score 1) 184
No, think a little harder.
Imagine a file system that names the files with strings of bytes.
It is absolutely vital that if I ask for a list of files and then try to open them, that this all work, no matter what byte sequence has managed to get in there as a filename.
It is also *nice* but nowhere near as vital that I be able to show these names to users and they read them as Unicode strings.
While many file systems do likely represent file names with strings of bytes, odds are that the OS is using some kind of encoding for those filenames. After all, the OS should be able to display filenames to the user, right?
So, it all boils down to what the Python 3.0 os.listdir (and related) routines return. I don't know the answer to that offhand (and I don't feel like building Python 3.0 to confirm). If Python has no idea what encoding the filenames are in, it has no choice but to return bytes objects.
You can only ever get a unicode object if you know what encoding the source is, and that would go for filenames as well.