From 7a0791b6992d420dc52536257f2f093851ed7215 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 17 Sep 2018 16:22:29 -0700 Subject: 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. --- Python/coreconfig.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Python/coreconfig.c') diff --git a/Python/coreconfig.c b/Python/coreconfig.c index 1e03ce31f3..131a043ff2 100644 --- a/Python/coreconfig.c +++ b/Python/coreconfig.c @@ -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; } -- cgit v1.2.1