]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-42260: Fix _PyConfig_Read() if compute_path_config=0 (GH-23220)
authorVictor Stinner <vstinner@python.org>
Tue, 10 Nov 2020 20:10:22 +0000 (21:10 +0100)
committerGitHub <noreply@github.com>
Tue, 10 Nov 2020 20:10:22 +0000 (21:10 +0100)
commitace3f9a0ce7b9fe8ae757fdd614f1e7a171f92b0
tree2d4d60ce52caedd15d8825c2fc2842340ae21d31
parent1e996c3a3b51e9c6f1f4cea8a6dbcf3bcb865060
bpo-42260: Fix _PyConfig_Read() if compute_path_config=0 (GH-23220)

Fix _PyConfig_Read() if compute_path_config=0: use values set by
Py_SetPath(), Py_SetPythonHome() and Py_SetProgramName(). Add
compute_path_config parameter to _PyConfig_InitPathConfig().

The following functions now return NULL if called before
Py_Initialize():

* Py_GetExecPrefix()
* Py_GetPath()
* Py_GetPrefix()
* Py_GetProgramFullPath()
* Py_GetProgramName()
* Py_GetPythonHome()

These functions no longer automatically computes the Python Path
Configuration. Moreover, Py_SetPath() no longer computes
program_full_path.
Doc/c-api/init.rst
Doc/c-api/init_config.rst
Doc/whatsnew/3.10.rst
Include/internal/pycore_initconfig.h
Misc/NEWS.d/next/C API/2020-11-10-14-27-39.bpo-42260.-Br3Co.rst [new file with mode: 0644]
Python/initconfig.c
Python/pathconfig.c
Python/pylifecycle.c