Skip to content Skip to sidebar Skip to footer

Fatal Error During Py_finalize In Embedded Python Application

Thanks for your help with this -- variations on this question have been asked many times, but I haven't found a complete answer. I am adding embedded Python 3.4.2 to an existing si

Solution 1:

You are calling Py_Finalize without holding the global interpreter lock. This is not allowed: the lock must be held for every Python API call, with the single exception of the call that acquires the GIL itself.

The ACQUIRE_PY_GIL RAII guard is not useful for this purpose, as it would try to release the GIL after Py_Finalize returns — in this case, you must call PyGILState_Ensure without the matching release.

Post a Comment for "Fatal Error During Py_finalize In Embedded Python Application"