[Python-ideas] PEP 540: Add a new UTF-8 mode

INADA Naoki songofacandy at gmail.com
Wed Jan 11 02:31:09 EST 2017


>
> That kind of thing makes me very nervous, and I think justifiably so.
> And it's only *sufficient* to justify a change to Python's defaults if
> Python checks for and accurately identifies when it's in a container.
>

In my company, we use network boot servers.
To reduce boot image, the image is built with minimalistic approach too.
So there were only C locale in most of our servers, and many
people in my company had bitten by this problem.

I teach them to adding `export PYTHONIOENCODING=utf-8` in their
.bashrc.  But they had bitten again when using cron.

So this problem is not only for docker container.
Since UTF-8 dominated, many people including me use C locale
to avoid unintentional behavior of commands seeing locale (sort,
ls, date, bash, etc...).

And use non C locale only for reading non English output from some
command, like `man` or `hg help`.  It's for i18n / l10n, but not for
changing encoding.

People live in UTF-8 world are never helped by changing encoding by locale.
They are only bitten by the behavior.

> Anyway, I need to look more carefully at the actual PEPs and see if
> there's something concrete to worry about.  But remember, we have
> about 18 months to chew over this if necessary -- I'm only asking for
> a few more days (until after the "cripple the minds of Japanese youth
> day", er, "University Admissions Center Examination" this weekend ;-).
>
> Steve

Off course.  And both PEP doesn't propose default behavior except C locale.
So there are 36+ months about changing default behavior.
I hope 36 months is enough for people using legacy systems are moving to
UTF-8 world.

Regards,


More information about the Python-ideas mailing list