On this page
sqlite3.DataError
Prev: sqlite3.DatabaseError | Up: sqlite3 | Next: sqlite3.Date
Rel: sqlite3.adapt, sqlite3.Binary, sqlite3.Blob, sqlite3.complete_statement
Ref: docs.python.org โ sqlite3.DataError
Tags: #public #python3 #stdlib #sqlite3
Import
import sqlite3
from sqlite3 import DataError
Signature & Overview
sqlite3.DataError(...)
sqlite3.DataError class.
Methods & Attributes
DataError.add_note(self, note, /)โ Add a note to the exceptionDataError.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import sqlite3
# DB-API 2.0 exception for data-processing errors (subclass of DatabaseError)
assert issubclass(sqlite3.DataError, sqlite3.DatabaseError)
Gotchas
- Rarely raised directly by SQLite: Because SQLite uses dynamic typing, most schema/constraint failures raise
IntegrityErrororOperationalErrorinstead.
REPL Inspect
from sqlite3 import DataError
help(DataError)
Linked from
Related notes
- tuts/python3/stdlib_module/sqlite3 Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/DatabaseError Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sqlite3/Date 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