[issue44113] [C API] Deprecate legacy API for configure Python initialization

STINNER Victor report at bugs.python.org
Wed May 12 06:20:54 EDT 2021


New submission from STINNER Victor <vstinner at python.org>:

The https://docs.python.org/dev/c-api/init.html documentation lists many functions which is the legacy way to configure the Python initialization. These functions are kept for backward compatibility but have flaws and are less reliable than the new PyConfig API (PEP 587) documented at https://docs.python.org/dev/c-api/init_config.html

I propose to deprecate the legacy functions to configure the Python initialization. Examples:

* Py_SetPath()
* Py_SetProgramName()
* Py_SetPythonHome()
* Py_SetStandardStreamEncoding()
* PySys_AddWarnOption()
* PySys_AddWarnOptionUnicode()
* PySys_AddXOption()

I don't propose to schedule the removal of these functions, only mark them as deprecated in the *documentation*.

Related issue: bpo-43956 "C-API: Incorrect default value for Py_SetProgramName" and PR 24876.

----------
assignee: docs at python
components: C API, Documentation
messages: 393499
nosy: docs at python, vstinner
priority: normal
severity: normal
status: open
title: [C API] Deprecate legacy API for configure Python initialization
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44113>
_______________________________________


More information about the Python-bugs-list mailing list