[issue34589] Py_Initialize() and Py_Main() should not enable C locale coercion

STINNER Victor report at bugs.python.org
Thu Sep 13 14:50:29 EDT 2018


STINNER Victor <vstinner at redhat.com> added the comment:

> LC_CTYPE=C PYTHONCOERCECLOCALE=0 python3 -E ...

The UTF-8 Mode has the same behavior: PYTHONUTF8 env var is ignored when using -E, but enabled by the C locale: you can use -X utf8=0 in that case to ensure that the UTF-8 Mode is disabled.

I wanted to propose you to add a new -X option, ex: -X coerce_c_locale=0, which would have the priority over the environment variable. I'm not a big fan of env vars, it's not always convenient to use them. I prefer an env var, but both are even better :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34589>
_______________________________________


More information about the Python-bugs-list mailing list