Skip to content

Use _PyCoreConfig rather than global configuration variables #81081

Description

@vstinner
BPO 36900
Nosy @vstinner
PRs
  • bpo-36900: import.c uses PyInterpreterState.core_config #13278
  • bpo-36900: Replace global conf vars with config #13299
  • bpo-36900: Fix compilation on HP-UX #13614
  • 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-05-14.15:35:57.545>
    created_at = <Date 2019-05-13.11:07:28.616>
    labels = ['interpreter-core', '3.8']
    title = 'Use _PyCoreConfig rather than global configuration variables'
    updated_at = <Date 2019-05-28.10:24:04.155>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2019-05-28.10:24:04.155>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-05-14.15:35:57.545>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2019-05-13.11:07:28.616>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36900
    keywords = ['patch']
    message_count = 6.0
    messages = ['342310', '342338', '342398', '342478', '342479', '343760']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = ['13278', '13299', '13614']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36900'
    versions = ['Python 3.8']

    Activity

    1. vstinner commented on May 13, 2019

      @vstinner
      MemberAuthor

      PyInterpreterState.config is now preferred over global configuration variables, so two interpreters can have a different configuration, the "state" of an interpreter is now better defined (especially when and how its configuration is set).

      Attached PRs fix these isssues.

    2. vstinner commented on May 13, 2019

      @vstinner
      MemberAuthor

      New changeset 410b85a by Victor Stinner in branch 'master':
      bpo-36900: import.c uses PyInterpreterState.core_config (GH-13278)
      410b85a

    3. vstinner commented on May 13, 2019

      @vstinner
      MemberAuthor

      With PR 13299, most global variable configurables are not directly accessed, outside code to initialize _PyPreConfig and _PyCoreConfig.

      parser.c: Py_DebugFlag
      fileutils.c: Py_UTF8Mode, Py_LegacyWindowsFSEncodingFlag
      frozenmain.c: Py_VerboseFlag
      Py_FdIsInteractive(): Py_InteractiveFlag
      PySys_SetArgv(): Py_IsolatedFlag()
      Py_GETENV(): Py_IsolatedFlag

      The problem is that these files, functions and macros may be used before Python is initialized: before Python has an interpreter.

    4. vstinner commented on May 14, 2019

      @vstinner
      MemberAuthor

      New changeset c96be81 by Victor Stinner in branch 'master':
      bpo-36900: Replace global conf vars with config (GH-13299)
      c96be81

    5. vstinner commented on May 14, 2019

      @vstinner
      MemberAuthor

      There are a few remaining usage of these global configuration variables, but it will be tricky to remove them:
      https://bugs.python.org/issue36900#msg342398

      I consider that I'm done on this topic, so I close the issue.

    6. vstinner commented on May 28, 2019

      @vstinner
      MemberAuthor

      New changeset 9ea277a by Victor Stinner in branch 'master':
      bpo-36900: Fix compilation on HP-UX (GH-13614)
      9ea277a

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

      3.8 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions