diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-05-17 20:44:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-17 20:44:16 (GMT) |
commit | bcfbbd704646622e919c1306a91fba61d603483d (patch) | |
tree | 51238f56ba837c49330424bd995b2de71b5a5a48 /Include | |
parent | 98ff4d5fb6a9d01b0176b7786db61346952e5295 (diff) | |
download | cpython-bcfbbd704646622e919c1306a91fba61d603483d.zip cpython-bcfbbd704646622e919c1306a91fba61d603483d.tar.gz cpython-bcfbbd704646622e919c1306a91fba61d603483d.tar.bz2 |
bpo-36945: Add _PyPreConfig.configure_locale (GH-13368)
_PyPreConfig_InitIsolatedConfig() sets configure_locale to 0 to
prevent Python to modify the LC_CTYPE locale. In that case,
coerce_c_locale an coerce_c_locale_warn are set to 0 as well.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/coreconfig.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Include/cpython/coreconfig.h b/Include/cpython/coreconfig.h index 7d561ce..73861a9 100644 --- a/Include/cpython/coreconfig.h +++ b/Include/cpython/coreconfig.h @@ -79,6 +79,10 @@ typedef struct { set to !Py_IgnoreEnvironmentFlag. */ int use_environment; + /* Set the LC_CTYPE locale to the user preferred locale? If equals to 0, + set coerce_c_locale and coerce_c_locale_warn to 0. */ + int configure_locale; + /* Coerce the LC_CTYPE locale if it's equal to "C"? (PEP 538) Set to 0 by PYTHONCOERCECLOCALE=0. Set to 1 by PYTHONCOERCECLOCALE=1. @@ -147,6 +151,7 @@ typedef struct { ._config_version = _Py_CONFIG_VERSION, \ .isolated = -1, \ .use_environment = -1, \ + .configure_locale = 1, \ .utf8_mode = -2, \ .dev_mode = -1, \ .allocator = PYMEM_ALLOCATOR_NOT_SET} |