bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 1 Dec 2017 19:09:52 +0000 (20:09 +0100)
committerGitHub <noreply@github.com>
Fri, 1 Dec 2017 19:09:52 +0000 (20:09 +0100)
commitebac19dad6263141d5db0a2c923efe049dba99d2
tree9dd0111510cfc339f2e88c24592d04bf11e0a17b
parent9ac3d8882712c9675c3d2f9f84af6b5729575cde
bpo-32030: Don't call _PyPathConfig_Fini() in Py_FinalizeEx() (#4667)

Changes:

* _PyPathConfig_Fini() cannot be called in Py_FinalizeEx().
  Py_Initialize() and Py_Finalize() can be called multiple times, but
  it must not "forget" parameters set by Py_SetProgramName(),
  Py_SetPath() or Py_SetPythonHome(), whereas _PyPathConfig_Fini()
  clear all these parameters.
* config_get_program_name() and calculate_program_full_path() now
  also decode paths using Py_DecodeLocale() to use the
  surrogateescape error handler, rather than decoding using
  mbstowcs() which is strict.
* Change _Py_CheckPython3() prototype: () => (void)
* Truncate a few lines which were too long
Include/pylifecycle.h
Modules/getpath.c
Modules/main.c
PC/getpathp.c
Python/pylifecycle.c