GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — C API: Remove deprecated API to configure Python initialization · Issue #158001 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
Closed
C API: Remove deprecated API to configure Python initialization#158001
Copy link
Labels
topic-C-API

Description

@vstinner
vstinner
opened on Sep 23, 2026
Issue body actions

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

  • gh-158001: Avoid deprecated variable in Py_GETENV() #158003
  • gh-158001: No longer read global config vars in PyConfig_Read() #158014
  • gh-158001: Remove global configuration variables from C API #158020
  • gh-158001: Remove Py_SetProgramName() function #158024
  • gh-158001: Fix test_ctypes.test_version_var() on s390x #158193

Activity

  1. vstinner
    added
    topic-C-API
    on Sep 23, 2026
  2. vstinner
    added 8 commits that reference this issue on Sep 23, 2026

    gh-158001: Avoid deprecated variable in Py_GETENV() (#158003)

    becfd65

    pythongh-158001: No longer read global config vars in PyConfig_Read()

    5de0133

    pythongh-158001: No longer read global config vars in PyConfig_Read()

    d7e1d66

    gh-158001: No longer read global config vars in PyConfig_Read() (#158014

    2f5791d

    pythongh-158001: Remove global configuration variables from C API

    8f3e9ab

    pythongh-158001: Remove global configuration variables from C API

    eb053c3

    pythongh-158001: Remove Py_SetProgramName() function

    3372411

    pythongh-158001: Remove Py_SetProgramName() function

    969c9ce
  3. vstinner
    changed the title [-]C API: Remove deprecate API to configure Python initialization[/-] [+]C API: Remove deprecated API to configure Python initialization[/+] on Sep 23, 2026
  4. vstinner
    added 2 commits that reference this issue on Sep 24, 2026

    gh-158001: Remove Py_SetProgramName() function (#158024)

    a5a4659

    gh-158001: Remove global configuration variables from C API (#158020)

    7242fea
  5. vstinner
    closed this as completedon Sep 24, 2026
  6. vstinner commented on Sep 24, 2026

    @vstinner
    vstinner
    on Sep 24, 2026
    MemberAuthor
    More actions

    I created https://discuss.python.org/t/c-api-migrate-embedded-python-to-pyconfig-and-pyinitconfig-apis/109215 discussion to communicate on these removed functions and variables.

  7. vstinner
    added a commit that references this issue on Sep 25, 2026

    gh-158001: Fix test_ctypes.test_version_var() on s390x (#158193)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-C-API

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.