]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-105145: Remove old functions to config Python init (#105154)
authorVictor Stinner <vstinner@python.org>
Thu, 1 Jun 2023 07:14:02 +0000 (09:14 +0200)
committerGitHub <noreply@github.com>
Thu, 1 Jun 2023 07:14:02 +0000 (09:14 +0200)
commit424049cc1117d66dfa86196ee5f694c15b46ac6c
tree92dbbd5558deb687efb53e653d667ba6af608930
parent8ed705c083e8e5ff37649d998a8b1524ec921519
gh-105145: Remove old functions to config Python init (#105154)

Remove the following old functions to configure the Python
initialization, deprecated in Python 3.11:

* PySys_AddWarnOptionUnicode()
* PySys_AddWarnOption()
* PySys_AddXOption()
* PySys_HasWarnOptions()
* PySys_SetArgvEx()
* PySys_SetArgv()
* PySys_SetPath()
* Py_SetPath()
* Py_SetProgramName()
* Py_SetPythonHome()
* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Most of these functions are kept in the stable ABI, except:

* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Update Doc/extending/embedding.rst and Doc/extending/extending.rst to
use the new PyConfig API.

_testembed.c:

* check_stdio_details() now sets stdio_encoding and stdio_errors
  of PyConfig.
* Add definitions of functions removed from the API but kept in the
  stable ABI.
* test_init_from_config() and test_init_read_set() now use
  PyConfig_SetString() instead of PyConfig_SetBytesString().

Remove _Py_ClearStandardStreamEncoding() internal function.
22 files changed:
Doc/c-api/init.rst
Doc/c-api/init_config.rst
Doc/c-api/intro.rst
Doc/c-api/sys.rst
Doc/data/stable_abi.dat
Doc/extending/embedding.rst
Doc/extending/extending.rst
Doc/library/sys_path_init.rst
Doc/using/windows.rst
Doc/whatsnew/3.13.rst
Include/cpython/pylifecycle.h
Include/internal/pycore_pylifecycle.h
Include/pylifecycle.h
Include/sysmodule.h
Misc/NEWS.d/next/C API/2023-05-31-16-51-18.gh-issue-105145.b3B6lJ.rst [new file with mode: 0644]
Misc/stable_abi.toml
Modules/main.c
Programs/_testembed.c
Python/initconfig.c
Python/pathconfig.c
Python/pylifecycle.c
Python/sysmodule.c