[Python-3000] Pre-PEP: Easy Text File Decoding

Paul Prescod paul at prescod.net
Tue Sep 12 00:30:15 CEST 2006


On 9/11/06, Paul Moore <p.f.moore at gmail.com> wrote:
> On 9/11/06, Michael Chermside <mcherm at mcherm.com> wrote:
> > Paul Prescod writes:
> >      [... Pre-PEP proposal ...]
> >
> > Quick thoughts:
>
> My quick thoughts on this whole subject:
>
> * Yes, it should be "open". Anything else feels like gratuitous breakage.
> * There should be a default encoding, and it should be the system
> default one. If I don't take special steps, most tools I use save in
> the system default encoding, so Python should follow this approach as
> well.

So just to be clear: you want to keep the function name "open" but
change its behaviour. For example, the ord() of high characters
returned by open will be completely different than today. And the
syntax for "open" of binary files will be different (in fact, whether
it reads the file or throws an exception will depend on your locale).

> The bizarre Windows behavious of using different
> encodings for console and GUI programs doesn't
> bother me either. Really. I promise."

So according to this philosophy, Windows and Mac users will probably
never be able to open UTF-8 documents by default even if every
Microsoft app generates and consumes UTF-8 by default, because
Microsoft and Apple will probably _never change the default locale_
for backwards compatibility reasons. Their philosophy seems to be that
the locale is irrelevant in the age of Unicode and therefore there is
no reason to upgrade it at a risk of "breaking" applications that were
hard-coded to expect a specific locale.

 Paul Prescod


More information about the Python-3000 mailing list