diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-08-28 23:29:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-28 23:29:06 (GMT) |
commit | 124b9eb4e41ba1676dad954eec9a1fb3480794e4 (patch) | |
tree | 896bb0524d76ed32915e24b2320b0a8b0628ba57 /Modules | |
parent | 2c8ddcf4f14f3e4c87a6fe6678ab5ad09130c6ab (diff) | |
download | cpython-124b9eb4e41ba1676dad954eec9a1fb3480794e4.zip cpython-124b9eb4e41ba1676dad954eec9a1fb3480794e4.tar.gz cpython-124b9eb4e41ba1676dad954eec9a1fb3480794e4.tar.bz2 |
bpo-34485: Add _Py_ClearStandardStreamEncoding() (GH-8982)
* Move Py_SetStandardStreamEncoding() from pylifecycle.c
to coreconfig.c
* Add _Py_ClearStandardStreamEncoding() private function.
* pymain_free() now calls _Py_ClearStandardStreamEncoding().
* Add assertions add the end of _PyCoreConfig_Read()
* _PyCoreConfig_Copy(): rename COPY_STR_ATTR() macro
to COPY_WSTR_ATTR().
* Fix get_stdio_errors() indentation.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/main.c b/Modules/main.c index 82e0093..f93ca4d 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -466,6 +466,7 @@ pymain_free(_PyMain *pymain) remain valid after Py_Finalize(), since Py_Initialize()-Py_Finalize() can be called multiple times. */ _PyPathConfig_ClearGlobal(); + _Py_ClearStandardStreamEncoding(); /* Force the allocator used by pymain_read_conf() */ PyMemAllocatorEx old_alloc; @@ -1262,7 +1263,6 @@ pymain_read_conf_impl(_PyMain *pymain, _PyCoreConfig *config, return -1; } - assert(config->use_environment >= 0); if (config->use_environment) { err = cmdline_init_env_warnoptions(pymain, config, cmdline); if (_Py_INIT_FAILED(err)) { |