Currently, two calls can raise exceptions in the _trace_callback() in Modules/_sqlite/connection.c:
1. PyUnicode_DecodeUTF8() can raise an exception
2. PyObject_CallOneArg() — calling the user callback — can raise an exception
Currently, we either PyErr_Print() the traceback, or we PyErr_Clear() it. In either case; we clear the current exception. The other SQLite callbacks pass some kind of return value back to SQLite to indicate failure (which is normally then passed to _pysqlite_seterror() via sqlite3_step() or sqlite3_finalize(), but the trace callback does not pass errors back to SQLite; we're unable to detect if the trace callback fails. |