aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/coreconfig.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-23 04:12:27 +0200
committerGitHub <noreply@github.com>2019-05-23 04:12:27 +0200
commit20e1e2582e5e69e43af88ff58699c8883d146acb (patch)
tree2726fa5c02f6b7ddd00eede7ecdaa2f5587e6fd7 /Python/coreconfig.c
parentbc2aa816620c5e02ad8e94d8514b7e8f3f551ca1 (diff)
downloadcpython-20e1e2582e5e69e43af88ff58699c8883d146acb.tar.gz
cpython-20e1e2582e5e69e43af88ff58699c8883d146acb.zip
bpo-36763: Fix _PyPreConfig_InitCompatConfig() utf8_mode (GH-13518)
* _PyPreConfig_InitCompatConfig() sets utf8_mode to 0. * Change Py_UTF8Mode default value to 0. * Fix _PyPreConfig_Copy(): copy also _config_init attrbibute. * _PyPreConfig_AsDict() exports _config_init * Fix _PyPreConfig_GetGlobalConfig(): use Py_UTF8Mode if it's greater than 0, even if utf8_mode >= 0. * Add unit tests on environment variables using Python API.
Diffstat (limited to 'Python/coreconfig.c')
-rw-r--r--Python/coreconfig.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/coreconfig.c b/Python/coreconfig.c
index 40dba4ee5e5..89ccff4c9b7 100644
--- a/Python/coreconfig.c
+++ b/Python/coreconfig.c
@@ -107,9 +107,8 @@ static const char usage_6[] =
/* --- Global configuration variables ----------------------------- */
/* UTF-8 mode (PEP 540): if equals to 1, use the UTF-8 encoding, and change
- stdin and stdout error handler to "surrogateescape". It is equal to
- -1 by default: unknown, will be set by Py_Main() */
-int Py_UTF8Mode = -1;
+ stdin and stdout error handler to "surrogateescape". */
+int Py_UTF8Mode = 0;
int Py_DebugFlag = 0; /* Needed by parser.c */
int Py_VerboseFlag = 0; /* Needed by import.c */
int Py_QuietFlag = 0; /* Needed by sysmodule.c */