]> granicus.if.org Git - python/commit
bpo-36763: Add _PyPreConfig._config_init (GH-13481)
authorVictor Stinner <vstinner@redhat.com>
Wed, 22 May 2019 21:58:50 +0000 (23:58 +0200)
committerGitHub <noreply@github.com>
Wed, 22 May 2019 21:58:50 +0000 (23:58 +0200)
commit022be02dcfdfd9011415804bb4553a33fa7ec8f3
tree6c4f3b4afed8475e6504786cb176044eade9ef02
parente4d300e07c33a9a77549c62d8687d8fe130c53d5
bpo-36763: Add _PyPreConfig._config_init (GH-13481)

* _PyPreConfig_GetGlobalConfig() and  _PyCoreConfig_GetGlobalConfig()
  now do nothing if the configuration was not initialized with
  _PyPreConfig_InitCompatConfig() and _PyCoreConfig_InitCompatConfig()
* Remove utf8_mode=-2 special case: use utf8_mode=-1 instead.
* Fix _PyPreConfig_InitPythonConfig():

  * isolated = 0 instead of -1
  * use_environment = 1 instead of -1

* Rename _PyConfig_INIT to  _PyConfig_INIT_COMPAT
* Rename _PyPreConfig_Init() to _PyPreConfig_InitCompatConfig()
* Rename _PyCoreConfig_Init() to _PyCoreConfig_InitCompatConfig()
* PyInterpreterState_New() now uses _PyCoreConfig_InitPythonConfig()
  as default configuration, but it's very quickly overriden anyway.
* _freeze_importlib.c uses _PyCoreConfig_SetString() to set
  program_name.
* Cleanup preconfig_init_utf8_mode(): cmdline is always non-NULL.
Include/cpython/coreconfig.h
Include/internal/pycore_coreconfig.h
Lib/test/test_embed.py
Programs/_freeze_importlib.c
Programs/_testembed.c
Python/coreconfig.c
Python/frozenmain.c
Python/pathconfig.c
Python/preconfig.c
Python/pylifecycle.c
Python/pystate.c