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
(1) I suspect that should be either Py_Initialize() or Py_InitializeEx().
(2) Other functions can also be called first. The ones I notice are:
(2a) Py_IsInitialized() wouldn't be useful if you couldn't call it first.
(2b) Py_SetStandardStreamEncoding explicitly says it *should* be called before Py_Initialize, if it is called at all.
(Probably applies to earlier python versions as well.)
bpo-32124 changed the documentation to define the C functions that are safe to call before Py_Initialize. I am going to close this with that as a superseder. Please reopen this if that issue didn't address all the concerns. Thanks!
Activity
jimjjewett commentedon Sep 14, 2017
Per https://docs.python.org/3/c-api/init.html#initializing-and-finalizing-the-interpreter Py_Initialize() "should be called before using any other Python/C API functions; with the exception of Py_SetProgramName(), Py_SetPythonHome() and Py_SetPath()."
(1) I suspect that should be either Py_Initialize() or Py_InitializeEx().
(2) Other functions can also be called first. The ones I notice are:
(2a) Py_IsInitialized() wouldn't be useful if you couldn't call it first.
(2b) Py_SetStandardStreamEncoding explicitly says it *should* be called before Py_Initialize, if it is called at all.
(Probably applies to earlier python versions as well.)
csabella commentedon Mar 21, 2019
bpo-32124 changed the documentation to define the C functions that are safe to call before Py_Initialize. I am going to close this with that as a superseder. Please reopen this if that issue didn't address all the concerns. Thanks!