[Python-Dev] Late Python 3.7.1 changes to fix the C locale coercion (PEP 538) implementation
ncoghlan at gmail.com
Thu Sep 20 07:06:44 EDT 2018
On Thu, 20 Sep 2018 at 20:20, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Thu, 20 Sep 2018 at 06:48, Ned Deily <nad at python.org> wrote:
> > On Sep 19, 2018, at 15:08, Victor Stinner <vstinner at redhat.com> wrote:
> > > Le mardi 18 septembre 2018, Victor Stinner <vstinner at redhat.com> a écrit :
> > > > Hi Unicode and locales lovers,
> > > >
> > > > tl; dr Nick, Ned, INADA-san: I modified 3.7.1 to add a new "-X
> > > > coerce_c_locale=value" option and make sure that the C locale coercion
> > > > cannot be when Python in embedded: are you ok with these changes?
> > >
> > > Nick asked me to revert, which means that no, he is not ok with these changes.
> > >
> > > I reverted my change in 3.7.
> > Thank you, Victor!
> > Nick, with regard to this does the current state of the 3.7 branch look acceptable now for a 3.7.1?
> It's still broken relative to the PEP in the following respects:
> - Py_Initialize() coerces the C locale to C.UTF-8, even though it's
> not supposed to
> - Py_Main() coerces the C locale to C.UTF-8, even though it's not supposed to
> - PYTHONCOERCECLOCALE=0 doesn't work if -E or -I are passed on the
> command line (but it's supposed to)
> - PYTHONCOERCECLOCALE=warn doesn't work if -E or -I are passed on the
> command line (it's nominally supposed to do this too, but I'm less
> concerned about this one)
It's worth noting that even though the PYTHONCOERCECLOCALE=0 off
switch doesn't currently work as described in PEP 538 when passing -E
or -I, setting "LC_ALL=C" does (since that's handled by the C library,
independently of any CPython command line flags).
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev