[Python-Dev] PEP 538 warning at startup: please remove it

Nick Coghlan ncoghlan at gmail.com
Mon Jun 12 08:24:56 EDT 2017

On 12 June 2017 at 18:56, Victor Stinner <victor.stinner at gmail.com> wrote:
> Hi,
> Nick Coghlan pushed his implementation of his PEP 538: nice! Nice step
> forward to UTF-8 everywhere ;-)
> I would prefer to not be annoyed by warning messages about encodings
> at startup if possible:
> "Python detected LC_CTYPE=C: LC_CTYPE coerced to C.UTF-8 (set another
> locale or PYTHONCOERCECLOCALE=0 to disable this locale coercion
> behavior)."

Note that there's an open issue for this linked from the What's New entry:

* https://docs.python.org/dev/whatsnew/3.7.html#pep-538-legacy-c-locale-coercion
* https://bugs.python.org/issue30565

I suspect the eventual outcome is going to be dropping that particular
warning (since it's been problematic for Fedora's 3.6 backport as
well, and the problems are due to the warning itself, *not* the locale
coercion), but I'd prefer to keep the notification at least for a
while (potentially even until alpha 1).

OTOH, I'm also open to being persuaded otherwise if enough folks are
running into problems with it just while working on CPython (I'd still
like to turn it back on for alpha 1 even if we turn off in the
meantime, though).


P.S. Part of my rationale for doing it this way is that I'm certain
that after 3.7's release next year we're going to get at least a few
users genuinely upset at our decision to move the ASCII-based C locale
explicitly into the "legacy partially-supported environment" category,
and even more upset that we're "silently ignoring their explicit
configuration settings" by implicitly coercing it to something else.

Those kinds of concerns are much easier to address effectively if we
can say "We tried it with an explicit warning, and it was too annoying
to be usable; see <issue link> if you want more details" than if we're
in the situation of having to say "We assumed an explicit warning
would be too annoying, so we never even tried it".

Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list