[Python-ideas] Python 3 open() text files: make encoding parameter optional for cross-platform scripts

Yuval Greenfield ubershmekel at gmail.com
Sun Jun 9 15:13:10 CEST 2013


On Sun, Jun 9, 2013 at 2:24 PM, Chris Angelico <rosuav at gmail.com> wrote:

> On Sun, Jun 9, 2013 at 9:09 PM, anatoly techtonik <techtonik at gmail.com>
> wrote:
> > I can not agree with your generic priorities in approach to application
> > desing, which are:
> > 1. Program should be able to read 3rd-party files produced on the same
> > system
> > 2. Program should be able to read its own files on any system
> >
> > My choice is 2 then 1.
>
> #2 is easily achieved: just provide a specific encoding. It's your
> program, so you can control what it writes.
>
>
Both are easily achieved.

The discussion is about open()'s default, implicit behavior. I'm in favor
of #2 with utf-8 because it's consistent, easing python collaboration
across platforms, and does the right thing. Albeit an opinionated thing.

Those who worship false encodings turn their backs on all utf-8's mercies...

Yuval
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130609/b6f67cb3/attachment.html>


More information about the Python-ideas mailing list