Skip to content

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 31, 2023

Remove the following old functions to configure the Python initialization, deprecated in Python 3.11:

  • PySys_AddWarnOptionUnicode()
  • PySys_AddWarnOption()
  • PySys_AddXOption()
  • PySys_HasWarnOptions()
  • PySys_SetArgvEx()
  • PySys_SetArgv()
  • PySys_SetPath()
  • Py_SetPath()
  • Py_SetProgramName()
  • Py_SetPythonHome()
  • Py_SetStandardStreamEncoding()
  • _Py_SetProgramFullPath()

Most of these functions are kept in the stable ABI, except:

  • Py_SetStandardStreamEncoding()
  • _Py_SetProgramFullPath()

Update Doc/extending/embedding.rst and Doc/extending/extending.rst to use the new PyConfig API.

_testembed.c:

  • check_stdio_details() now sets stdio_encoding and stdio_errors of PyConfig.
  • Add definitions of functions removed from the API but kept for the stable ABI.
  • test_init_from_config() and test_init_read_set() now use PyConfig_SetString() instead of PyConfig_SetBytesString().

Remove _Py_ClearStandardStreamEncoding() internal function.

Remove the following old functions to configure the Python
initialization, deprecated in Python 3.11:

* PySys_AddWarnOptionUnicode()
* PySys_AddWarnOption()
* PySys_AddXOption()
* PySys_HasWarnOptions()
* PySys_SetArgvEx()
* PySys_SetArgv()
* PySys_SetPath()
* Py_SetPath()
* Py_SetProgramName()
* Py_SetPythonHome()
* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Most of these functions are kept in the stable ABI, except:

* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Update Doc/extending/embedding.rst and Doc/extending/extending.rst to
use the new PyConfig API.

_testembed.c:

* check_stdio_details() now sets stdio_encoding and stdio_errors
  of PyConfig.
* Add definitions of functions removed from the API but kept for the
  stable ABI.
* test_init_from_config() and test_init_read_set() now use
  PyConfig_SetString() instead of PyConfig_SetBytesString().

Remove _Py_ClearStandardStreamEncoding() internal function.
@vstinner vstinner force-pushed the remove_old_init_funcs branch from c16e3c9 to 1453a74 Compare May 31, 2023 16:11
@vstinner
Copy link
Member Author

It's funny to find such very old comment:

   .. XXX impl. doesn't seem consistent in allowing ``0``/``NULL`` for the params;
      check w/ Guido.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants