[Python-Dev] Late Python 3.7.1 changes to fix the C locale coercion (PEP 538) implementation (original) (raw)

Victor Stinner vstinner at redhat.com
Wed Sep 19 07:47:36 EDT 2018


Le mer. 19 sept. 2018 à 09:50, Nick Coghlan <ncoghlan at gmail.com> a écrit :

I think the changes to both master and the 3.7 branch should be reverted.

Ok, I prepared a PR to revert the 3.7 change: https://github.com/python/cpython/pull/9416

For 3.7, I already said that I think we should just accept that that ship has sailed with 3.7.0 and leave the as-shipped implementation alone for the rest of the 3.7 series: (...) For 3.8, (...), my PR should be conflict free again, and we'll be able to get PEP 538 back to working the way it was always supposed to work (...)

I read all your comments, and honestly, I don't understand you. Once you say:

"we don't actually want anyone turning off locale coercion except for debugging purposes" https://bugs.python.org/issue34589#msg325554

but you also say that Python 3.7.0 is broken on Centos 7 because it's not possible to disable C locale coercion using -E flag: https://bugs.python.org/issue34589#msg325246

And here (your email), one more time, you insist to support "PYTHONCOERCECLOCALE=0 python3 -E".

I don't understand if you want PYTHONCOERCECLOCALE to be ignored when using -E or not.

Since the PEP 538 is something new, we don't have much feedback of users to know if it causes any troubles, so I agree that we should provide a way to disable the feature, as I provided a way to disable the UTF-8 Mode when the LC_CTYPE is C or POSIX. Just to give user a full control on locales and encodings.

That's why I came up with a new -X coerce_c_locale option which can be used even with -E. I understood that you like the option, since you proposed to use it: https://bugs.python.org/issue34589#msg325493

--

Moreover, you asked me to make sure that Py_Initialize() and Py_Main() cannot enable C locale coercion. That's what I did.

--

IMHO the implementation is really a secondary concern here, the main question is: what is the correct behavior?

Nick:

I understood that your reply is yes for the second question, since you insist to push your change which also prevent Py_Initialize() and Py_Main() to enable C locale coercion.

If we change 3.7.0 behavior in 3.8, I would prefer to change the behavior in 3.7.1. IMHO it's not too late to fix 3.7.

--

I decided to push a concrete implementation because I understood that you was ok for the -X coerce_c_locale option and you asked me to fix my mistakes. I feel guilty that I broke the implementation of your PEP :-( Moreover, I'm also exhausted by fixing locales and encodings, I'm doing that for one year now, and I expected many times that I was done with all regressions and corner cases...

We are discussing these issues since 3 weeks and we failed to fix them, whereas Ned asked to push last fixes before 3.7.1. I sent an email to make sure that we all agree on the solution.

Well, it seems like again, we failed to agree on the expected behavior.

Victor



More information about the Python-Dev mailing list