[Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

Steven D'Aprano steve at pearwood.info
Tue Apr 28 02:27:17 CEST 2009

On Tue, 28 Apr 2009 04:13:47 am Antoine Pitrou wrote:
> Stephen J. Turnbull <stephen <at> xemacs.org> writes:
> > So what you'll get here, AFAICS, is a new situation where many
> > Windows-centric programmers will produce code that's incapable of
> > dealing with non-Unicode input because they don't have to care
> > about the distinction between Unicode and bytes.
> I don't understand what you're saying. py3k filenames are all
> unicode, even on POSIX systems, 

How is that possible on POSIX systems where the underlying file system 
uses bytes for filenames?

If I write a piece of Python code:

    filename = 'some path/some name'

I might call it a filename, I might think of it as a filename, but it 
*isn't*, it's a string in a Python program. It isn't a filename until 
it hits the file system, and in POSIX systems that makes it bytes.

Steven D'Aprano

More information about the Python-Dev mailing list