Python 3 encoding question: Read a filename from stdin, subsequently open that filename

Antoine Pitrou solipsis at pitrou.net
Wed Dec 1 04:15:41 EST 2010


On Tue, 30 Nov 2010 22:22:01 -0500
Albert Hopkins <marduk at letterboxes.org> wrote:
> And I can freely copy
> these "invalid" files across different (Unix) systems, because the OS
> doesn't care about encoding.

And so can Python, thanks to PEP 383.

> >  That's where encodings which can be used globally come in.
> > By the time Python 4 is released I'd be surprised if Unix hadn't
> > standardised on a single encoding like UTF-8. 
> 
> I have serious doubts about that.  At least in the Linux world the
> kernel wants to stay out of encoding debates (except where it has to
> like Window filesystems).

That doesn't matter. Vendors (Linux distributions) have to make a
choice and that choice will probably standardize on UTF-8 in most
situations. The kernel won't have a say, since it doesn't care
about encodings anyway.

> The world does not revolve around Python.  Unix filenames have been
> encoding-agnostic long before Python was around.  If Python3 does not
> support this then it's a regression on Python's part.

Python 3 does support it, see other messages about using bytes
filenames.

Regards

Antoine.





More information about the Python-list mailing list