[Python-Dev] PEP 540: Add a new UTF-8 mode (v2)

INADA Naoki songofacandy at gmail.com
Tue Dec 5 23:07:18 EST 2017

Oh, revised version is really short!

And I have one worrying point.
With UTF-8 mode, open()'s default encoding/error handler is

Containers are really growing.  PyCharm supports Docker and many new Python
developers use Docker instead of installing Python directly on their system,
especially on Windows.

And opening binary file without "b" option is very common mistake of new
developers.  If default error handler is surrogateescape, they lose a chance
to notice their bug.

On the other hand, it helps some use cases when user want byte-transparent
behavior, without modifying code to use "surrogateescape" explicitly.

Which is more important scenario?  Anyone has opinion about it?
Are there any rationals and use cases I missing?


INADA Naoki  <songofacandy at gmail.com>

On Wed, Dec 6, 2017 at 12:17 PM, INADA Naoki <songofacandy at gmail.com> wrote:
> I'm sorry about my laziness.
> I've very busy these months, but I'm back to OSS world from today.
> While I should review carefully again, I think I'm close to accept PEP 540.
> * PEP 540 really helps containers and old Linux machines PEP 538 doesn't work.
>   And containers is really important for these days.  Many new
> Pythonistas who is
>   not Linux experts start using containers.
> * In recent years, UTF-8 fixed many mojibakes.  Now UnicodeError is
> more usability
>   problem for many Python users.  So I agree opt-out UTF-8 mode is
> better than opt-in
>   on POSIX locale.
> I don't have enough time to read all mails in ML archive.
> So if someone have opposite opinion, please remind me by this weekend.
> Regards,

More information about the Python-Dev mailing list