On this page
sqlite3.enable_callback_tracebacks
Prev: sqlite3.DateFromTicks | Up: sqlite3 | Next: sqlite3.Error
Rel: sqlite3.adapt, sqlite3.Binary, sqlite3.Blob, sqlite3.complete_statement
Ref: docs.python.org — sqlite3.enable_callback_tracebacks
Tags: #public #python3 #stdlib #sqlite3
Import
import sqlite3
from sqlite3 import enable_callback_tracebacks
Signature & Overview
sqlite3.enable_callback_tracebacks(enable, /)
Enable or disable callback functions throwing errors to stderr.
Usage
import sqlite3
sqlite3.enable_callback_tracebacks(True)
# Now exceptions inside custom SQL functions/aggregates print full tracebacks to stderr
sqlite3.enable_callback_tracebacks(False)
Gotchas
- Essential when debugging custom SQL functions: By default, exceptions raised inside
create_function()callbacks are swallowed into a genericOperationalError: user-defined function raised exception.
REPL Inspect
from sqlite3 import enable_callback_tracebacks
help(enable_callback_tracebacks)
Linked from
Related notes
- tuts/python3/stdlib_module/sqlite3 Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/DateFromTicks Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/Error Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/adapt Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/Binary Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/Blob Linked here; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/complete_statement Linked here; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib