Skip to content

"Embedding Python in Another Application" documentation examples use deprecated functions #95709

Closed

Description

@vstinner

Examples of the C API documentation should be updated to use the new PyConfig API, rather than deprecated functions like Py_SetProgramName():

In the intro, this paragraph is outdated:

The embedding application can steer the search by calling Py_SetProgramName(file) before calling Py_Initialize(). Note that PYTHONHOME still overrides this and PYTHONPATH is still inserted in front of the standard path. An application that requires total control has to provide its own implementation of Py_GetPath(), Py_GetPrefix(), Py_GetExecPrefix(), and Py_GetProgramFullPath() (all defined in Modules/getpath.c).

Activity

  1. added
    docsDocumentation in the Doc dir
    3.11only security fixes
    3.12only security fixes
    on Aug 5, 2022
  2. erlend-aasland commented on Aug 5, 2022

    @erlend-aasland
    Contributor
  3. ncoghlan commented on Oct 16, 2022

    @ncoghlan
    Contributor

    When updating the embedding docs, the changes should be clear that the simple Py_Initialize and Py_InitializeEx configuration APIs are not deprecated: what's deprecated are the pre-init configuration API functions that rely on global variables to pass settings to the initialization functions. If embedders want non-default interpreter behaviour, they should switch over to the config struct based Py_InitializeFromConfig API.

  4. vstinner commented on Dec 13, 2022

    @vstinner
    MemberAuthor

    Sadly, I failed to find the bandwidth to update the doc. I created this issue as a TODO item, but my TODO list is full of more important stuff as usual, so I prefer to close it. If someone is volunteer, please go ahead, the old API is now deprecated!

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

    3.11only security fixes3.12only security fixes3.13only security fixesdocsDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions