diff options
author | Victor Stinner <vstinner@python.org> | 2021-05-12 21:59:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-12 21:59:25 (GMT) |
commit | 6cd0446ef72c6676b292d7f54b1ddb8ae5e1fb8d (patch) | |
tree | 096a9091641c61c9c45ce91ce2daa0c7eff8c121 /Doc/c-api/sys.rst | |
parent | 504ffdae4e0cb7775f3e584c3b1d20c262fdfd7e (diff) | |
download | cpython-6cd0446ef72c6676b292d7f54b1ddb8ae5e1fb8d.zip cpython-6cd0446ef72c6676b292d7f54b1ddb8ae5e1fb8d.tar.gz cpython-6cd0446ef72c6676b292d7f54b1ddb8ae5e1fb8d.tar.bz2 |
bpo-44113: Deprecate old functions to config Python init (GH-26060)
Deprecate the following functions to configure the Python
initialization:
* PySys_AddWarnOption()
* PySys_AddWarnOptionUnicode()
* PySys_AddXOption()
* PySys_HasWarnOptions()
* Py_SetPath()
* Py_SetProgramName()
* Py_SetPythonHome()
* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()
Use the new PyConfig API of the Python Initialization Configuration
instead (PEP 587).
Diffstat (limited to 'Doc/c-api/sys.rst')
-rw-r--r-- | Doc/c-api/sys.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/c-api/sys.rst b/Doc/c-api/sys.rst index 97717f5..cca8b7b 100644 --- a/Doc/c-api/sys.rst +++ b/Doc/c-api/sys.rst @@ -237,11 +237,21 @@ accessible to C code. They all work with the current interpreter thread's .. c:function:: void PySys_AddWarnOption(const wchar_t *s) + This API is kept for backward compatibility: setting + :c:member:`PyConfig.warnoptions` should be used instead, see :ref:`Python + Initialization Configuration <init-config>`. + Append *s* to :data:`sys.warnoptions`. This function must be called prior to :c:func:`Py_Initialize` in order to affect the warnings filter list. + .. deprecated:: 3.11 + .. c:function:: void PySys_AddWarnOptionUnicode(PyObject *unicode) + This API is kept for backward compatibility: setting + :c:member:`PyConfig.warnoptions` should be used instead, see :ref:`Python + Initialization Configuration <init-config>`. + Append *unicode* to :data:`sys.warnoptions`. Note: this function is not currently usable from outside the CPython @@ -250,6 +260,8 @@ accessible to C code. They all work with the current interpreter thread's called until enough of the runtime has been initialized to permit the creation of Unicode objects. + .. deprecated:: 3.11 + .. c:function:: void PySys_SetPath(const wchar_t *path) Set :data:`sys.path` to a list object of paths found in *path* which should @@ -294,12 +306,18 @@ accessible to C code. They all work with the current interpreter thread's .. c:function:: void PySys_AddXOption(const wchar_t *s) + This API is kept for backward compatibility: setting + :c:member:`PyConfig.xoptions` should be used instead, see :ref:`Python + Initialization Configuration <init-config>`. + Parse *s* as a set of :option:`-X` options and add them to the current options mapping as returned by :c:func:`PySys_GetXOptions`. This function may be called prior to :c:func:`Py_Initialize`. .. versionadded:: 3.2 + .. deprecated:: 3.11 + .. c:function:: PyObject *PySys_GetXOptions() Return the current dictionary of :option:`-X` options, similarly to |