[Python-checkins] bpo-34523: Fix config_init_fs_encoding() (GH-8991)

Victor Stinner webhook-mailer at python.org
Wed Aug 29 07:45:37 EDT 2018


https://github.com/python/cpython/commit/70fead25e503a742ad4c919b151b9b2b5facee36
commit: 70fead25e503a742ad4c919b151b9b2b5facee36
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2018-08-29T13:45:34+02:00
summary:

bpo-34523: Fix config_init_fs_encoding() (GH-8991)

Call config_init_fs_encoding() if filesystem_errors is not NULL but
filesystem_encoding is NULL.

files:
M Python/coreconfig.c

diff --git a/Python/coreconfig.c b/Python/coreconfig.c
index 0ec4640336c7..625c743a419a 100644
--- a/Python/coreconfig.c
+++ b/Python/coreconfig.c
@@ -1344,7 +1344,7 @@ _PyCoreConfig_Read(_PyCoreConfig *config)
         config->argc = 0;
     }
 
-    if (config->filesystem_encoding == NULL && config->filesystem_errors == NULL) {
+    if (config->filesystem_encoding == NULL || config->filesystem_errors == NULL) {
         err = config_init_fs_encoding(config);
         if (_Py_INIT_FAILED(err)) {
             return err;



More information about the Python-checkins mailing list