]> granicus.if.org Git - python/commit
bpo-32030: Add _Py_FindEnvConfigValue() (#4963)
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 21 Dec 2017 15:49:13 +0000 (16:49 +0100)
committerGitHub <noreply@github.com>
Thu, 21 Dec 2017 15:49:13 +0000 (16:49 +0100)
commit9bee329130aae5a13050c08dab9d349b76e66835
tree828e5eba0807b15d60bb7f5162685d0dc993fc42
parent9dd762013fd9fcf975ad51700b55d050ca9ed60e
bpo-32030: Add _Py_FindEnvConfigValue() (#4963)

Add a new _Py_FindEnvConfigValue() function: code shared between
Windows and Unix implementations of _PyPathConfig_Calculate() to read
the pyenv.cfg file.

_Py_FindEnvConfigValue() now uses _Py_DecodeUTF8_surrogateescape()
instead of using a Python Unicode string, the Python API must not be
used early during Python initialization. Same change in Unix
search_for_exec_prefix(): use _Py_DecodeUTF8_surrogateescape().

Cleanup also encode_current_locale(): PyMem_RawFree/PyMem_Free can be
called with NULL.

Fix also "NUL byte" => "NULL byte" typo.
Include/fileutils.h
Include/pylifecycle.h
Modules/getpath.c
PC/getpathp.c
Python/fileutils.c
Python/pathconfig.c