Skip to content

Py_Initialize documentation wrong #75651

Closed

Description

@jimjjewett
BPO 31470
Nosy @JimJJewett, @csabella
Superseder
  • bpo-32124: Document functions safe to be called before Py_Initialize()
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-03-21.23:05:12.458>
    created_at = <Date 2017-09-14.16:31:01.976>
    labels = ['docs']
    title = 'Py_Initialize documentation wrong'
    updated_at = <Date 2019-03-21.23:05:12.457>
    user = 'https://github.com/JimJJewett'

    bugs.python.org fields:

    activity = <Date 2019-03-21.23:05:12.457>
    actor = 'cheryl.sabella'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2019-03-21.23:05:12.458>
    closer = 'cheryl.sabella'
    components = ['Documentation']
    creation = <Date 2017-09-14.16:31:01.976>
    creator = 'Jim.Jewett'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 31470
    keywords = []
    message_count = 2.0
    messages = ['302179', '338569']
    nosy_count = 3.0
    nosy_names = ['docs@python', 'Jim.Jewett', 'cheryl.sabella']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '32124'
    type = None
    url = 'https://bugs.python.org/issue31470'
    versions = ['Python 3.6']

    Activity

    1. jimjjewett commented on Sep 14, 2017

      jimjjewettmannequin
      MannequinAuthor

      Per https://docs.python.org/3/c-api/init.html#initializing-and-finalizing-the-interpreter Py_Initialize() "should be called before using any other Python/C API functions; with the exception of Py_SetProgramName(), Py_SetPythonHome() and Py_SetPath()."

      (1) I suspect that should be either Py_Initialize() or Py_InitializeEx().

      (2) Other functions can also be called first. The ones I notice are:
      (2a) Py_IsInitialized() wouldn't be useful if you couldn't call it first.
      (2b) Py_SetStandardStreamEncoding explicitly says it *should* be called before Py_Initialize, if it is called at all.

      (Probably applies to earlier python versions as well.)

    2. csabella commented on Mar 21, 2019

      @csabella
      Contributor

      bpo-32124 changed the documentation to define the C functions that are safe to call before Py_Initialize. I am going to close this with that as a superseder. Please reopen this if that issue didn't address all the concerns. Thanks!

    3. transferred this issue fromon Apr 10, 2022
    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

      docsDocumentation in the Doc dir

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions