[issue47019] Fatal Python Error in sqlite3 Python 3.10

hydroflask report at bugs.python.org
Tue Mar 15 15:36:21 EDT 2022


hydroflask <hydroflask at yqxmail.com> added the comment:

> All callbacks triggered from external libraries must protect Python C API calls. You may call it offending, but that is the reality; a callback may trigger at any point in time, so we need to make sure the GIL is held before calling any Py API. That is also the case for the destructor.

Sure but I'm suggesting sidestepping and not using the destructor_callback entirely. You can DECREF the callbacks manually in connection_close() after calling sqlite3_close_v2(). Doing this makes sense to me since the destructor may be called under special conditions.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47019>
_______________________________________


More information about the Python-bugs-list mailing list