You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use _PyCoreConfig rather than global configuration variables #81081
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=Noneclosed_at=<Date2019-05-14.15:35:57.545>created_at=<Date2019-05-13.11:07:28.616>labels= ['interpreter-core', '3.8']
title='Use _PyCoreConfig rather than global configuration variables'updated_at=<Date2019-05-28.10:24:04.155>user='https://github.com/vstinner'
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).
Activity
vstinner commentedon May 13, 2019
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.
vstinner commentedon May 13, 2019
New changeset 410b85a by Victor Stinner in branch 'master':
bpo-36900: import.c uses PyInterpreterState.core_config (GH-13278)
410b85a
vstinner commentedon May 13, 2019
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.
vstinner commentedon May 14, 2019
New changeset c96be81 by Victor Stinner in branch 'master':
bpo-36900: Replace global conf vars with config (GH-13299)
c96be81
vstinner commentedon May 14, 2019
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.
vstinner commentedon May 28, 2019
New changeset 9ea277a by Victor Stinner in branch 'master':
bpo-36900: Fix compilation on HP-UX (GH-13614)
9ea277a