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 — "Embedding Python in Another Application" documentation examples use deprecated functions · Issue #95709 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
Closed
"Embedding Python in Another Application" documentation examples use deprecated functions#95709
Copy link
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13only security fixesonly security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@vstinner
vstinner
opened on Aug 5, 2022
Issue body actions

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

  • https://docs.python.org/dev/c-api/intro.html#embedding-python
  • https://docs.python.org/dev/extending/extending.html
  • https://docs.python.org/dev/extending/embedding.html

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).

Reacted by Erlend E. Aasland, Koki Saito, Rakesh Sabale, Kumar Aditya and Oleg Iarygin

Activity

  1. vstinner
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Aug 5, 2022
  2. erlend-aasland
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    3.11only security fixesonly security fixes
    3.10 (EOL)end of lifeend of life
    3.12only security fixesonly security fixes
    on Aug 5, 2022
  3. erlend-aasland commented on Aug 5, 2022

    @erlend-aasland
    erlend-aasland
    on Aug 5, 2022
    Contributor
    More actions

    See also:

    • Extending/embedding Python documentation outdated/incomplete #88052
    • Undefined References when using recommended linking option: Embedding Python in C++  #93358
    • Update extending/embedding docs to new way to build modules in C #70702
    • C-API Pure Embedding enhancement #68840
    • [doc] Embedding into a shared library fails again #63352
    • Example in section 5.3 "Pure Embedding" doesn't work. #42771

    Perhaps we should mark those as superseded by this and actually update the docs :)

  4. erlend-aasland commented on Aug 5, 2022

    @erlend-aasland
    erlend-aasland
    on Aug 5, 2022
    Contributor
    More actions

    There are also slightly related issues:

    • python-config --embed documentation #83463
    • C API docs need a clear "defining custom extension types" section #64423
  5. kumaraditya303
    added
    easy
    on Aug 21, 2022
  6. ncoghlan commented on Oct 16, 2022

    @ncoghlan
    ncoghlan
    on Oct 16, 2022
    Contributor
    More actions

    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.

    Reacted by Erlend E. Aasland
  7. vstinner commented on Dec 13, 2022

    @vstinner
    vstinner
    on Dec 13, 2022
    MemberAuthor
    More actions

    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!

  8. vstinner
    closed this as completedon Dec 13, 2022
  9. arhadthedev
    added this to Contribution Queueon Feb 13, 2023
  10. github-project-automation
    moved this to Todo in Contribution Queueon Feb 13, 2023
  11. erlend-aasland
    reopened this on Aug 17, 2023
  12. erlend-aasland
    added
    3.13only security fixesonly security fixes
    and removed
    3.10 (EOL)end of lifeend of life
    easy
    on Aug 17, 2023
  13. vstinner
    closed this as completedon Dec 20, 2023
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 fixesonly security fixes3.12only security fixesonly security fixes3.13only security fixesonly security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    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.