
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2018-11-28 10:42 byvstinner, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 10806 | merged | vstinner,2018-11-29 23:25 | |
| PR 10813 | merged | vstinner,2018-11-30 10:45 | |
| Messages (4) | |||
|---|---|---|---|
| msg330590 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2018-11-28 10:42 | |
PYTHONCOERCECLOCALE=1 should not force C locale coercion, Python should still check if the LC_CTYPE locale is "C".Bug:$ ./python -c 'import locale; print(locale.setlocale(locale.LC_CTYPE, None))'fr_FR.UTF-8$ PYTHONCOERCECLOCALE=1 ./python -c 'import locale; print(locale.setlocale(locale.LC_CTYPE, None))'C.UTF-8It should be fr_FR.UTF-8 as well in the second example :-( It seems to be a regression that I introduced in the middle of my refactoring on the Python initialization.The bug is around:static voidconfig_init_locale(_PyCoreConfig *config){ if (config->coerce_c_locale < 0) { /* The C locale enables the C locale coercion (PEP 538) */ if (_Py_LegacyLocaleDetected()) { config->coerce_c_locale = 1; } } ...}The 3.7 branch and the 3.7.0 release are affected :-($ ./python -VPython 3.7.0$ PYTHONCOERCECLOCALE=1 ./python -c 'import locale; print(locale.setlocale(locale.LC_CTYPE, None))'C.UTF-8 | |||
| msg330768 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2018-11-30 10:34 | |
New changeset55e498058faf8c97840556f6d791c2c392732dc3 by Victor Stinner in branch 'master':bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806)https://github.com/python/cpython/commit/55e498058faf8c97840556f6d791c2c392732dc3 | |||
| msg330771 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2018-11-30 11:18 | |
> PYTHONCOERCECLOCALE=1 should not force C locale coercion, Python should still check if the LC_CTYPE locale is "C".Reference:https://docs.python.org/dev/using/cmdline.html#envvar-PYTHONCOERCECLOCALE"If (...) the current locale reported for the LC_CTYPE category is either the default C locale, or else the explicitly ASCII-based POSIX locale, (...)" | |||
| msg330772 -(view) | Author: STINNER Victor (vstinner)*![]() | Date: 2018-11-30 11:19 | |
New changesetdf738d56fe798b3586ed71775df25bf127789cf6 by Victor Stinner in branch '3.7':bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806) (GH-10813)https://github.com/python/cpython/commit/df738d56fe798b3586ed71775df25bf127789cf6 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:08 | admin | set | github: 79517 |
| 2018-11-30 11:20:02 | vstinner | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2018-11-30 11:19:50 | vstinner | set | messages: +msg330772 |
| 2018-11-30 11:18:31 | vstinner | set | messages: +msg330771 |
| 2018-11-30 10:45:27 | vstinner | set | pull_requests: +pull_request10058 |
| 2018-11-30 10:34:50 | vstinner | set | messages: +msg330768 |
| 2018-11-29 23:25:28 | vstinner | set | keywords: +patch stage: patch review pull_requests: +pull_request10052 |
| 2018-11-28 10:42:16 | vstinner | create | |