@@ -37,8 +37,6 @@ The following functions can be safely called before Python is initialized:
3737 * :c:func: `PyMem_SetAllocator `
3838 * :c:func: `PyMem_SetupDebugHooks `
3939 * :c:func: `PyObject_SetArenaAllocator `
40- * :c:func: `Py_SetProgramName `
41- * :c:func: `Py_SetPythonHome `
4240 * the configuration functions covered in :ref: `init-config `
4341
4442* Informative functions:
@@ -778,33 +776,6 @@ deleted. This can be done using interpreter views.
778776Process-wide parameters
779777-----------------------
780778
781- .. c :function :: void Py_SetProgramName (const wchar_t *name)
782-
783- .. index ::
784- single: Py_Initialize()
785- single: main()
786-
787- This API is kept for backward compatibility: setting
788- :c:member: `PyConfig.program_name ` should be used instead, see :ref: `Python
789- Initialization Configuration <init-config>`.
790-
791- This function should be called before :c:func: `Py_Initialize ` is called for
792- the first time, if it is called at all. It tells the interpreter the value
793- of the ``argv[0] `` argument to the :c:func: `main ` function of the program
794- (converted to wide characters).
795- This is used by some other functions below to find
796- the Python run-time libraries relative to the interpreter executable. The
797- default value is ``'python'``. The argument should point to a
798- zero-terminated wide character string in static storage whose contents will not
799- change for the duration of the program's execution. No code in the Python
800- interpreter will change the contents of this storage.
801-
802- Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
803- :c:expr:`wchar_t*` string.
804-
805- .. deprecated-removed:: 3.11 3.16
806-
807-
808779.. c :function :: const char * Py_GetVersion ()
809780
810781 Return the version of this Python interpreter. This is a string that looks
@@ -873,100 +844,3 @@ Process-wide parameters
873844 The returned string points into static storage; the caller should not modify its
874845 value. The value is available to Python code as part of the variable
875846 ``sys.version``.
876-
877-
878- .. c:function:: void PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath)
879-
880- .. index::
881- single: main()
882- single: Py_FatalError()
883- single: argv (in module sys)
884-
885- This API is kept for backward compatibility: setting
886- :c:member:`PyConfig.argv`, :c:member:`PyConfig.parse_argv` and
887- :c:member:`PyConfig.safe_path` should be used instead, see :ref:`Python
888- Initialization Configuration <init-config>`.
889-
890- Set :data:`sys.argv` based on *argc* and *argv*. These parameters are
891- similar to those passed to the program's :c:func:`main` function with the
892- difference that the first entry should refer to the script file to be
893- executed rather than the executable hosting the Python interpreter. If there
894- isn't a script that will be run, the first entry in *argv* can be an empty
895- string. If this function fails to initialize :data:`sys.argv`, a fatal
896- condition is signalled using :c:func:`Py_FatalError`.
897-
898- If *updatepath* is zero, this is all the function does. If *updatepath*
899- is non-zero, the function also modifies :data:`sys.path` according to the
900- following algorithm:
901-
902- - If the name of an existing script is passed in ``argv[0]``, the absolute
903- path of the directory where the script is located is prepended to
904- :data:`sys.path`.
905- - Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point
906- to an existing file name), an empty string is prepended to
907- :data:`sys.path`, which is the same as prepending the current working
908- directory (``" ." ``).
909-
910- Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
911- :c:expr:`wchar_t*` string.
912-
913- See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv`
914- members of the :ref:`Python Initialization Configuration <init-config>`.
915-
916- .. note::
917- It is recommended that applications embedding the Python interpreter
918- for purposes other than executing a single script pass ``0`` as *updatepath*,
919- and update :data:`sys.path` themselves if desired.
920- See :cve:`2008-5983`.
921-
922- On versions before 3.1.3, you can achieve the same effect by manually
923- popping the first :data:`sys.path` element after having called
924- :c:func:`PySys_SetArgv`, for example using::
925-
926- PyRun_SimpleString(" import sys; sys.path.pop(0 )\n" );
927-
928- .. versionadded:: 3.1.3
929-
930- .. deprecated-removed:: 3.11 3.16
931-
932-
933- .. c:function:: void PySys_SetArgv(int argc, wchar_t **argv)
934-
935- This API is kept for backward compatibility: setting
936- :c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` should be used
937- instead, see :ref:`Python Initialization Configuration <init-config>`.
938-
939- This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set
940- to ``1`` unless the :program:`python` interpreter was started with the
941- :option:`-I`.
942-
943- Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
944- :c:expr:`wchar_t*` string.
945-
946- See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv`
947- members of the :ref:`Python Initialization Configuration <init-config>`.
948-
949- .. versionchanged:: 3.4 The *updatepath* value depends on :option:`-I`.
950-
951- .. deprecated-removed:: 3.11 3.16
952-
953-
954- .. c:function:: void Py_SetPythonHome(const wchar_t *home)
955-
956- This API is kept for backward compatibility: setting
957- :c:member:`PyConfig.home` should be used instead, see :ref:`Python
958- Initialization Configuration <init-config>`.
959-
960- Set the default " home" directory, that is, the location of the standard
961- Python libraries. See :envvar:`PYTHONHOME` for the meaning of the
962- argument string.
963-
964- The argument should point to a zero-terminated character string in static
965- storage whose contents will not change for the duration of the program's
966- execution. No code in the Python interpreter will change the contents of
967- this storage.
968-
969- Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
970- :c:expr:`wchar_t*` string.
971-
972- .. deprecated-removed:: 3.11 3.16
0 commit comments