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

Hrvoje Nikšić hrvoje.niksic at avl.com
Tue Sep 30 12:52:56 CEST 2008

On Tue, 2008-09-30 at 19:45 +1000, Nick Coghlan wrote:
> To my mind, there are two kinds of app in the world when it comes to
> file paths:
> 1) "Normal" apps (e.g. a word processor), that are only interested in
> files with sane, well-formed file names that can be properly decoded to
> Unicode with the filesystem encoding identified by Python. If there is
> invalid data on the filesystem, they don't care and don't want to see it
> or have to deal with it.

I am not convinced that a word processor can just ignore files with
(what it thinks are) undecodable file names.  In countries with a
history of incompatible national encodings, such file names crop up very
often, sometimes as a natural consequence of data migrating from older
systems to newer ones.  You can and do encounter "invalid" file names in
the filesystems of mainstream users even without them using buggy or
obsolete software.

More information about the Python-Dev mailing list