[Python-Dev] Patch for an initial support of bytes filename in Python3

Simon Cross hodgestar+pythondev at gmail.com
Wed Oct 1 10:05:38 CEST 2008

On Wed, Oct 1, 2008 at 12:04 AM, Guido van Rossum <guido at python.org> wrote:
> Plus, even on Linux Unicode is *usually* what you should be doing,
> unless you're writing a backup tool.

I still find this line of reasoning a bit worrying. Imagine an end
user application like a music player. The user discovers that he can't
see some .mp3 or .ogg file from the music player that is visibile is
the file manager. I would expect him to file a bug on the music
player. If the bug was closed with "fix the filename" I imagine the
user would respond with "but other programs can access it just fine".

I'm not unhappy with the solution Victor is proposing, but I imagine
that when I start coding projects in 3.0 I'll default to the bytes
versions of the filename methods and use
b"path".decode(sys.getfilesystemencoding(), "replace") if I need to
get Unicode.

More information about the Python-Dev mailing list