Skip to content

Commit 05a7da4

Browse files
committed
remove Py_GetProgramName
1 parent 4fcd377 commit 05a7da4

File tree

17 files changed

+11
-47
lines changed

17 files changed

+11
-47
lines changed

Doc/c-api/init.rst

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ The following functions can be safely called before Python is initialized:
7979
the following functions **should not be called** before the interpreter has
8080
been initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`,
8181
:c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`,
82-
:c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`,
83-
:c:func:`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, and
82+
:c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:`PyEval_InitThreads`, and
8483
:c:func:`Py_RunMain`.
8584

8685

@@ -609,23 +608,6 @@ Process-wide parameters
609608
.. deprecated-removed:: 3.11 3.15
610609
611610
612-
.. c:function:: wchar_t* Py_GetProgramName()
613-
614-
Return the program name set with :c:member:`PyConfig.program_name`, or the default.
615-
The returned string points into static storage; the caller should not modify its
616-
value.
617-
618-
This function should not be called before :c:func:`Py_Initialize`, otherwise
619-
it returns ``NULL``.
620-
621-
.. versionchanged:: 3.10
622-
It now returns ``NULL`` if called before :c:func:`Py_Initialize`.
623-
624-
.. deprecated-removed:: 3.13 3.15
625-
Use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
626-
(:data:`sys.executable`) instead.
627-
628-
629611
.. c:function:: wchar_t* Py_GetPrefix()
630612
631613
Return the *prefix* for installed platform-independent files. This is derived

Doc/data/refcounts.dat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,8 +3017,6 @@ Py_GetPrefix:wchar_t*:::
30173017

30183018
Py_GetProgramFullPath:wchar_t*:::
30193019

3020-
Py_GetProgramName:wchar_t*:::
3021-
30223020
Py_GetVersion:const char*:::
30233021

30243022
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
@@ -39,9 +39,6 @@ Pending removal in Python 3.15
3939
* :c:func:`Py_GetProgramFullPath`:
4040
Use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
4141
(:data:`sys.executable`) instead.
42-
* :c:func:`Py_GetProgramName`:
43-
Use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
44-
(:data:`sys.executable`) instead.
4542
* :c:func:`Py_GetPythonHome`:
4643
Use :c:func:`PyConfig_Get("home") <PyConfig_Get>` or the
4744
:envvar:`PYTHONHOME` environment variable instead.

Doc/whatsnew/3.10.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,7 @@ Porting to Python 3.10
21782178
21792179
* :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`,
21802180
:c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and
2181-
:c:func:`Py_GetProgramName` functions now return ``NULL`` if called before
2181+
: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`.
21842184
(Contributed by Victor Stinner in :issue:`42260`.)

Doc/whatsnew/3.13.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,7 @@ Deprecated C APIs
24852485
Get :data:`sys.prefix` instead.
24862486
* :c:func:`Py_GetProgramFullPath`:
24872487
Get :data:`sys.executable` instead.
2488-
* :c:func:`Py_GetProgramName`:
2488+
* :c:func:`!Py_GetProgramName`:
24892489
Get :data:`sys.executable` instead.
24902490
* :c:func:`Py_GetPythonHome`:
24912491
Get :c:member:`PyConfig.home`

Doc/whatsnew/3.15.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,7 @@ Deprecated C APIs
155155
Removed C APIs
156156
--------------
157157

158+
* :c:func:`!Py_GetProgramName`:
159+
use :c:func:`PyConfig_Get("executable") <PyConfig_Get>`
160+
(:data:`sys.executable`) instead.
161+

Doc/whatsnew/3.8.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ Build and C API Changes
16301630

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

16361636

Include/pylifecycle.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv);
3535

3636
/* In pathconfig.c */
3737
Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *);
38-
Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
3938

4039
Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetPythonHome(const wchar_t *);
4140
Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetPythonHome(void);

Lib/test/test_embed.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,7 +1712,6 @@ def test_global_pathconfig(self):
17121712
# - Py_GetPath()
17131713
# - Py_GetPrefix()
17141714
# - Py_GetProgramFullPath()
1715-
# - Py_GetProgramName()
17161715
# - Py_GetPythonHome()
17171716
#
17181717
# The global path configuration (_Py_path_config) must be a copy
@@ -1728,7 +1727,6 @@ def get_func(name):
17281727
Py_GetPath = get_func('Py_GetPath')
17291728
Py_GetPrefix = get_func('Py_GetPrefix')
17301729
Py_GetExecPrefix = get_func('Py_GetExecPrefix')
1731-
Py_GetProgramName = get_func('Py_GetProgramName')
17321730
Py_GetProgramFullPath = get_func('Py_GetProgramFullPath')
17331731
Py_GetPythonHome = get_func('Py_GetPythonHome')
17341732

@@ -1738,7 +1736,6 @@ def get_func(name):
17381736
config['module_search_paths'])
17391737
self.assertEqual(Py_GetPrefix(), config['prefix'])
17401738
self.assertEqual(Py_GetExecPrefix(), config['exec_prefix'])
1741-
self.assertEqual(Py_GetProgramName(), config['program_name'])
17421739
self.assertEqual(Py_GetProgramFullPath(), config['executable'])
17431740
self.assertEqual(Py_GetPythonHome(), config['home'])
17441741

0 commit comments

Comments
 (0)