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
"Embedding Python in Another Application" documentation examples use deprecated functions #95709
The embedding application can steer the search by calling Py_SetProgramName(file) before calling Py_Initialize(). Note that PYTHONHOME still overrides this and PYTHONPATH is still inserted in front of the standard path. An application that requires total control has to provide its own implementation of Py_GetPath(), Py_GetPrefix(), Py_GetExecPrefix(), and Py_GetProgramFullPath() (all defined in Modules/getpath.c).
When updating the embedding docs, the changes should be clear that the simple Py_Initialize and Py_InitializeEx configuration APIs are not deprecated: what's deprecated are the pre-init configuration API functions that rely on global variables to pass settings to the initialization functions. If embedders want non-default interpreter behaviour, they should switch over to the config struct based Py_InitializeFromConfig API.
Sadly, I failed to find the bandwidth to update the doc. I created this issue as a TODO item, but my TODO list is full of more important stuff as usual, so I prefer to close it. If someone is volunteer, please go ahead, the old API is now deprecated!
Activity
erlend-aasland commentedon Aug 5, 2022
See also:
Perhaps we should mark those as superseded by this and actually update the docs :)
erlend-aasland commentedon Aug 5, 2022
There are also slightly related issues:
ncoghlan commentedon Oct 16, 2022
When updating the embedding docs, the changes should be clear that the simple
Py_InitializeandPy_InitializeExconfiguration APIs are not deprecated: what's deprecated are the pre-init configuration API functions that rely on global variables to pass settings to the initialization functions. If embedders want non-default interpreter behaviour, they should switch over to the config struct basedPy_InitializeFromConfigAPI.vstinner commentedon Dec 13, 2022
Sadly, I failed to find the bandwidth to update the doc. I created this issue as a TODO item, but my TODO list is full of more important stuff as usual, so I prefer to close it. If someone is volunteer, please go ahead, the old API is now deprecated!