Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue35336

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Bug in C locale coercion with PYTHONCOERCECLOCALE=1
Type:Stage:resolved
Components:Interpreter CoreVersions:Python 3.8, Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: vstinner
Priority:normalKeywords:patch

Created on2018-11-28 10:42 byvstinner, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 10806mergedvstinner,2018-11-29 23:25
PR 10813mergedvstinner,2018-11-30 10:45
Messages (4)
msg330590 -(view)Author: STINNER Victor (vstinner)*(Python committer)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)*(Python committer)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)*(Python committer)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)*(Python committer)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
DateUserActionArgs
2022-04-11 14:59:08adminsetgithub: 79517
2018-11-30 11:20:02vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-11-30 11:19:50vstinnersetmessages: +msg330772
2018-11-30 11:18:31vstinnersetmessages: +msg330771
2018-11-30 10:45:27vstinnersetpull_requests: +pull_request10058
2018-11-30 10:34:50vstinnersetmessages: +msg330768
2018-11-29 23:25:28vstinnersetkeywords: +patch
stage: patch review
pull_requests: +pull_request10052
2018-11-28 10:42:16vstinnercreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp