summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-06-15 22:06:28 (GMT)
committerGitHub <noreply@github.com>2018-06-15 22:06:28 (GMT)
commit6c5a4b315664f21bffc36ff6987fb4c4d1590897 (patch)
tree94fc8921373846fe5227f58619bd54eeacd0a25b /Modules
parent2f9cbaa8b2190b6dfd3157ede9b6973523a3b939 (diff)
downloadcpython-6c5a4b315664f21bffc36ff6987fb4c4d1590897.zip
cpython-6c5a4b315664f21bffc36ff6987fb4c4d1590897.tar.gz
cpython-6c5a4b315664f21bffc36ff6987fb4c4d1590897.tar.bz2
bpo-33824, bpo-32030: Fix pymain_read_conf() (GH-7712)
Fix "LC_ALL=C python3.7 -V": reset properly the command line parser when the encoding changes after reading the Python configuration. Fix pymain_read_conf(): use memset(0) to reset properly cmdline.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 286ad41..3809fa4 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -2015,6 +2015,7 @@ pymain_read_conf(_PyMain *pymain, _Py_CommandLineDetails *cmdline)
Py_IgnoreEnvironmentFlag = init_ignore_env;
_PyCoreConfig_Clear(&pymain->config);
pymain_clear_cmdline(pymain, cmdline);
+ memset(cmdline, 0, sizeof(*cmdline));
pymain_get_global_config(pymain, cmdline);
/* The encoding changed: read again the configuration