Skip to content

C API: Remove deprecated API to configure Python initialization #158001

Description

@vstinner

PySys_SetArgv(), PySys_SetArgvEx(), Py_SetProgramName() and Py_SetPythonHome() are deprecated since Python 3.11 and planned for removal in Python 3.16.

The "global configuration variables" such as Py_IgnoreEnvironmentFlag are deprecated since Python 3.11 and planned for removal in Python 3.16.

I'm working on changes to remove these APIs. The PyInitConfig API (Python 3.14) or the PyConfig API (Python 3.8) can be used instead. Reading global configuration variables can be replaced with PyConfig_Get().

In May 2025, there was a first attempt to remove global configuration variables. A code search found 20 projects still using these variables. The removal was (postponed)(#149594) from Python 3.15 to Python 3.16.

See also issue gh-154757 "26 C APIs scheduled for removal in 3.16 are still present".

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions