This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hydroflask
Recipients erlendaasland, hydroflask
Date 2022-03-15.00:18:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org>
In-reply-to
Content
_destructor in connection.c in Python 3.10+ now calls `PyGILState_Ensure()`, this is a problem because if the destructor is being called while the thread is being torn down it will cause an unbalanced/erroneous call to "PyEval_RestoreThread" in PyGILState_Ensure which will eventually trigger a Fatal Python Error. A perfect repro has been attached, should be run on Linux.

My recommended fix is to call sqlite3_close() within Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS, and manually Py_DECREF all connection-related functions afterward.
History
Date User Action Args
2022-03-15 00:18:22hydroflasksetrecipients: + hydroflask, erlendaasland
2022-03-15 00:18:22hydroflasksetmessageid: <1647303502.31.0.146964727203.issue47019@roundup.psfhosted.org>
2022-03-15 00:18:22hydroflasklinkissue47019 messages
2022-03-15 00:18:22hydroflaskcreate