gh-105145: Deprecate Py_GetPath() function (#105179)

Deprecate old Python initialization functions:

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

_tkinter.c uses sys.executable instead of Py_GetProgramName()
and uses sys.prefix instead of Py_GetPrefix().
This commit is contained in:
Victor Stinner 2023-06-01 14:06:32 +02:00 committed by GitHub
parent ec0082ca46
commit c67121ac6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 57 additions and 12 deletions

View file

@ -429,6 +429,9 @@ Process-wide parameters
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Get :data:`sys.executable` instead.
.. c:function:: wchar_t* Py_GetPrefix()
@ -448,6 +451,9 @@ Process-wide parameters
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Get :data:`sys.prefix` instead.
.. c:function:: wchar_t* Py_GetExecPrefix()
@ -489,6 +495,9 @@ Process-wide parameters
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Get :data:`sys.exec_prefix` instead.
.. c:function:: wchar_t* Py_GetProgramFullPath()
@ -507,6 +516,9 @@ Process-wide parameters
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Get :data:`sys.executable` instead.
.. c:function:: wchar_t* Py_GetPath()
@ -532,6 +544,9 @@ Process-wide parameters
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Get :data:`sys.path` instead.
.. c:function:: const char* Py_GetVersion()
@ -615,6 +630,10 @@ Process-wide parameters
.. versionchanged:: 3.10
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Get :c:member:`PyConfig.home` or :envvar:`PYTHONHOME` environment
variable instead.
.. _threads:

View file

@ -237,6 +237,9 @@ accessible to C code. They all work with the current interpreter thread's
Reset :data:`sys.warnoptions` to an empty list. This function may be
called prior to :c:func:`Py_Initialize`.
.. deprecated-removed:: 3.13 3.15
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
.. c:function:: void PySys_WriteStdout(const char *format, ...)
Write the output string described by *format* to :data:`sys.stdout`. No