[issue18488] sqlite: finalize() method of user function may be called with an exception set if a call to step() method failed
STINNER Victor
report at bugs.python.org
Mon Jul 22 08:39:08 CEST 2013
STINNER Victor added the comment:
"+1 for PyException_SetContext or similar. The C code should behave like a "finally: x.finalize()"."
If the Python callback failed in _pysqlite_step_callback() or _pysqlite_final_callback(): the exception is printed if sqlite3.enable_callback_tracebacks() has been called, or cleared otherwise.
Only one kind of exception is expected to be passed to be caller (according to sqlite unit tests): AttributeError. The changeset 020dbfdf9517 restores the behaviour of Python 3.3 for best backward compatibility.
If you want better reporting, please open a new issue.
My only concern was just to not call a Python function while an exception is set: I fixed this issue using PyErr_Fetch/PyErr_Restore. So I'm closing the issue.
----------
resolution: -> fixed
status: open -> closed
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18488>
_______________________________________
More information about the Python-bugs-list
mailing list