Skip to content

Commit 2a57840

Browse files
committed
remove Py_GetProgramFullPath
1 parent 00ed990 commit 2a57840

File tree

17 files changed

+11
-55
lines changed

17 files changed

+11
-55
lines changed

Doc/c-api/init.rst

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ The following functions can be safely called before Python is initialized:
7777

7878
Despite their apparent similarity to some of the functions listed above,
7979
the following functions **should not be called** before the interpreter has
80-
been initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:`PyEval_InitThreads`, and
80+
been initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPythonHome`, :c:func:`PyEval_InitThreads`, and
8181
:c:func:`Py_RunMain`.
8282

8383

@@ -602,28 +602,6 @@ Process-wide parameters
602602
.. deprecated-removed:: 3.11 3.15
603603
604604
605-
.. c:function:: wchar_t* Py_GetProgramFullPath()
606-
607-
.. index::
608-
single: executable (in module sys)
609-
610-
Return the full program name of the Python executable; this is computed as a
611-
side-effect of deriving the default module search path from the program name
612-
(set by :c:member:`PyConfig.program_name`). The returned string points into
613-
static storage; the caller should not modify its value. The value is available
614-
to Python code as ``sys.executable``.
615-
616-
This function should not be called before :c:func:`Py_Initialize`, otherwise
617-
it returns ``NULL``.
618-
619-
.. versionchanged:: 3.10
620-
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
621-
622-
.. deprecated-removed:: 3.13 3.15
623-
Use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
624-
(:data:`sys.executable`) instead.
625-
626-
627605
.. c:function:: const char* Py_GetVersion()
628606
629607
Return the version of this Python interpreter. This is a string that looks

Doc/c-api/intro.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -779,16 +779,11 @@ found along :envvar:`PATH`.) The user can override this behavior by setting the
779779
environment variable :envvar:`PYTHONHOME`, or insert additional directories in
780780
front of the standard path by setting :envvar:`PYTHONPATH`.
781781

782-
.. index::
783-
single: Py_GetProgramFullPath (C function)
784-
785782
The embedding application can steer the search by setting
786783
:c:member:`PyConfig.program_name` *before* calling
787784
:c:func:`Py_InitializeFromConfig`. Note that
788785
:envvar:`PYTHONHOME` still overrides this and :envvar:`PYTHONPATH` is still
789-
inserted in front of the standard path. An application that requires total
790-
control has to provide its own implementation of :c:func:`Py_GetProgramFullPath`
791-
(defined in :file:`Modules/getpath.c`).
786+
inserted in front of the standard path.
792787

793788
.. index:: single: Py_IsInitialized (C function)
794789

Doc/data/refcounts.dat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3009,8 +3009,6 @@ Py_GetCopyright:const char*:::
30093009

30103010
Py_GetPlatform:const char*:::
30113011

3012-
Py_GetProgramFullPath:wchar_t*:::
3013-
30143012
Py_GetVersion:const char*:::
30153013

30163014
Py_INCREF:void:::

Doc/data/stable_abi.dat

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Doc/deprecations/c-api-pending-removal-in-3.15.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ Pending removal in Python 3.15
2222
may return a type other than :class:`bytes`, such as :class:`str`.
2323
* Python initialization functions, deprecated in Python 3.13:
2424

25-
* :c:func:`Py_GetProgramFullPath`:
26-
Use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
27-
(:data:`sys.executable`) instead.
2825
* :c:func:`Py_GetPythonHome`:
2926
Use :c:func:`PyConfig_Get("home") <PyConfig_Get>` or the
3027
:envvar:`PYTHONHOME` environment variable instead.

Doc/whatsnew/3.10.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,7 @@ Porting to Python 3.10
21772177
(Contributed by Victor Stinner in :issue:`42157`.)
21782178
21792179
* :c:func:`!Py_GetPath`, :c:func:`!Py_GetPrefix`, :c:func:`!Py_GetExecPrefix`,
2180-
:c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and
2180+
:c:func:`!Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and
21812181
:c:func:`!Py_GetProgramName` functions now return ``NULL`` if called before
21822182
:c:func:`Py_Initialize` (before Python is initialized). Use the new
21832183
:ref:`init-config` API to get the :ref:`init-path-config`.

Doc/whatsnew/3.13.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2483,7 +2483,7 @@ Deprecated C APIs
24832483
Get :data:`sys.path` instead.
24842484
* :c:func:`!Py_GetPrefix`:
24852485
Get :data:`sys.prefix` instead.
2486-
* :c:func:`Py_GetProgramFullPath`:
2486+
* :c:func:`!Py_GetProgramFullPath`:
24872487
Get :data:`sys.executable` instead.
24882488
* :c:func:`!Py_GetProgramName`:
24892489
Get :data:`sys.executable` instead.

Doc/whatsnew/3.15.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ Removed C APIs
170170
Use :c:func:`PyConfig_Get("prefix") <PyConfig_Get>`
171171
(:data:`sys.prefix`) if :ref:`virtual environments <venv-def>`
172172
need to be handled.
173+
* :c:func:`!Py_GetProgramFullPath`:
174+
use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
175+
(:data:`sys.executable`) instead.
173176
* :c:func:`!Py_GetProgramName`:
174177
use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
175178
(:data:`sys.executable`) instead.

Doc/whatsnew/3.8.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,7 @@ Build and C API Changes
16291629
(Contributed by Pablo Galindo in :issue:`37221`.)
16301630

16311631
* :c:func:`!Py_SetPath` now sets :data:`sys.executable` to the program full
1632-
path (:c:func:`Py_GetProgramFullPath`) rather than to the program name
1632+
path (:c:func:`!Py_GetProgramFullPath`) rather than to the program name
16331633
(:c:func:`!Py_GetProgramName`).
16341634
(Contributed by Victor Stinner in :issue:`38234`.)
16351635

Include/pylifecycle.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
3939
Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
4040
Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void);
4141

42-
Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
4342
#ifdef MS_WINDOWS
4443
int _Py_CheckPython3(void);
4544
#endif

0 commit comments

Comments
 (0)