close
The Wayback Machine - https://web.archive.org/web/20221226002338/https://github.com/python/cpython/pull/13388
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-36763: Add _PyCoreConfig_InitPythonConfig() #13388

Merged
merged 2 commits into from May 17, 2019

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 17, 2019

Add new functions to get the Python interpreter behavior:

  • _PyPreConfig_InitPythonConfig()
  • _PyCoreConfig_InitPythonConfig()

Add new functions to get an isolated configuration:

  • _PyPreConfig_InitIsolateConfig()
  • _PyCoreConfig_InitIsolateConfig()

Set _PyCoreConfig.configure_c_stdio to 0 by default to behave as
Python 3.7:

  • Py_Main() configures C standard streams
  • Py_Initialize() leaves C standard streams unchanged

_PyCoreConfig_Read() no longer sets coerce_c_locale_warn to 1 if it's
equal to 0. coerce_c_locale_warn must now be set to -1 (ex: using
_PyCoreConfig_InitPythonConfig()) to enable C locale coercion
warning.

Add unit tests for _PyCoreConfig_InitPythonConfig()
and _PyCoreConfig_InitIsolateConfig().

https://bugs.python.org/issue36763

Add new functions to get the Python interpreter behavior:

* _PyPreConfig_InitPythonConfig()
* _PyCoreConfig_InitPythonConfig()

Add new functions to get an isolated configuration:

* _PyPreConfig_InitIsolatedConfig()
* _PyCoreConfig_InitIsolatedConfig()

Replace _PyPreConfig_INIT and _PyCoreConfig_INIT with new functions
_PyPreConfig_Init() and _PyCoreConfig_Init().

_PyCoreConfig: set configure_c_stdio and parse_argv to 0 by default
to behave as Python 3.6.

_PyCoreConfig_Read() no longer sets coerce_c_locale_warn to 1 if it's
equal to 0. coerce_c_locale_warn must now be set to -1 (ex: using
_PyCoreConfig_InitPythonConfig()) to enable C locale coercion
warning.

Add unit tests for _PyCoreConfig_InitPythonConfig()
and _PyCoreConfig_InitIsolatedConfig().
@vstinner vstinner force-pushed the config_init_python_config branch from cd5cf82 to 95d0d9a Compare May 17, 2019
* Rename _PyCoreConfig_GetCoreConfig() to _PyPreConfig_GetCoreConfig()
* Fix core_read_precmdline(): handle parse_argv=0
* Fix _Py_PreInitializeFromCoreConfig(): pass coreconfig.argv
  to _Py_PreInitializeFromPyArgv(), except if parse_argv=0
@vstinner vstinner merged commit cab5d07 into python:master May 17, 2019
@vstinner vstinner deleted the config_init_python_config branch May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants