mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-34589: C locale coercion off by default (GH-9073)
Py_Initialize() and Py_Main() cannot enable the C locale coercion (PEP 538) anymore: it is always disabled. It can now only be enabled by the Python program ("python3). test_embed: get_filesystem_encoding() doesn't have to set PYTHONUTF8 nor PYTHONCOERCECLOCALE, these variables are already set in the parent.
This commit is contained in:
parent
1fa2ec49be
commit
7a0791b699
8 changed files with 49 additions and 16 deletions
|
@ -816,7 +816,9 @@ config_read_env_vars(_PyCoreConfig *config)
|
|||
}
|
||||
}
|
||||
else if (strcmp(env, "warn") == 0) {
|
||||
config->_coerce_c_locale_warn = 1;
|
||||
if (config->_coerce_c_locale_warn < 0) {
|
||||
config->_coerce_c_locale_warn = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (config->_coerce_c_locale < 0) {
|
||||
|
@ -1324,6 +1326,9 @@ _PyCoreConfig_Read(_PyCoreConfig *config)
|
|||
if (config->_coerce_c_locale < 0) {
|
||||
config->_coerce_c_locale = 0;
|
||||
}
|
||||
if (config->_coerce_c_locale_warn < 0) {
|
||||
config->_coerce_c_locale_warn = 0;
|
||||
}
|
||||
if (config->utf8_mode < 0) {
|
||||
config->utf8_mode = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue