single: Py_FatalError()
single: argv (in module sys)
+ This API is kept for backward compatibility: setting
+ :c:member:`PyConfig.argv`, :c:member:`PyConfig.parse_argv` and
+ :c:member:`PyConfig.safe_path` should be used instead, see :ref:`Python
+ Initialization Configuration <init-config>`.
+
Set :data:`sys.argv` based on *argc* and *argv*. These parameters are
similar to those passed to the program's :c:func:`main` function with the
difference that the first entry should refer to the script file to be
.. XXX impl. doesn't seem consistent in allowing ``0``/``NULL`` for the params;
check w/ Guido.
+ .. deprecated:: 3.11
+
.. c:function:: void PySys_SetArgv(int argc, wchar_t **argv)
+ This API is kept for backward compatibility: setting
+ :c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` should be used
+ instead, see :ref:`Python Initialization Configuration <init-config>`.
+
This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set
to ``1`` unless the :program:`python` interpreter was started with the
:option:`-I`.
.. versionchanged:: 3.4 The *updatepath* value depends on :option:`-I`.
+ .. deprecated:: 3.11
+
.. c:function:: void Py_SetPythonHome(const wchar_t *home)
:mod:`builtins`, :mod:`__main__`, and :mod:`sys`. It also
initializes the module search path (``sys.path``).
-.. index:: single: PySys_SetArgvEx()
-
:c:func:`Py_Initialize` does not set the "script argument list" (``sys.argv``).
-If this variable is needed by Python code that will be executed later, it must
-be set explicitly with a call to ``PySys_SetArgvEx(argc, argv, updatepath)``
-after the call to :c:func:`Py_Initialize`.
+If this variable is needed by Python code that will be executed later, setting
+:c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` must be set: see
+:ref:`Python Initialization Configuration <init-config>`.
On most systems (in particular, on Unix and Windows, although the details are
slightly different), :c:func:`Py_Initialize` calculates the module search path
.. c:function:: void PySys_SetPath(const wchar_t *path)
+ This API is kept for backward compatibility: setting
+ :c:member:`PyConfig.module_search_paths` and
+ :c:member:`PyConfig.module_search_paths_set` should be used instead, see
+ :ref:`Python Initialization Configuration <init-config>`.
+
Set :data:`sys.path` to a list object of paths found in *path* which should
be a list of paths separated with the platform's search path delimiter
(``:`` on Unix, ``;`` on Windows).
+ .. deprecated:: 3.11
+
.. c:function:: void PySys_WriteStdout(const char *format, ...)
Write the output string described by *format* to :data:`sys.stdout`. No
* :c:func:`PySys_AddWarnOption`
* :c:func:`PySys_AddXOption`
* :c:func:`PySys_HasWarnOptions`
+ * :c:func:`PySys_SetArgvEx`
+ * :c:func:`PySys_SetArgv`
+ * :c:func:`PySys_SetPath`
* :c:func:`Py_SetPath`
* :c:func:`Py_SetProgramName`
* :c:func:`Py_SetPythonHome`
Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization Configuration
<init-config>` instead (:pep:`587`).
- (Contributed by Victor Stinner in :issue:`44113`.)
+ (Contributed by Victor Stinner in :gh:`88279`.)
* Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:func:`PyObject_Hash` instead.
(Contributed by Inada Naoki in :issue:`46864`.)
PyAPI_FUNC(PyObject *) PySys_GetObject(const char *);
PyAPI_FUNC(int) PySys_SetObject(const char *, PyObject *);
-PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **);
-PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int);
-PyAPI_FUNC(void) PySys_SetPath(const wchar_t *);
+Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgv(int, wchar_t **);
+Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetArgvEx(int, wchar_t **, int);
+Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_SetPath(const wchar_t *);
PyAPI_FUNC(void) PySys_WriteStdout(const char *format, ...)
Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
--- /dev/null
+Deprecate the C functions: :c:func:`PySys_SetArgv`,
+:c:func:`PySys_SetArgvEx`, :c:func:`PySys_SetPath`. Patch by Victor Stinner.