[Python-checkins] cpython (3.5): Issue #6057: Document exceptions in sqlite3 module

berker.peksag python-checkins at python.org
Wed Aug 24 17:44:30 EDT 2016


https://hg.python.org/cpython/rev/1dbd1a9a6a9c
changeset:   102891:1dbd1a9a6a9c
branch:      3.5
parent:      102879:7ac8e8568da2
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Thu Aug 25 00:45:07 2016 +0300
summary:
  Issue #6057: Document exceptions in sqlite3 module

Patch by Jaysinh Shukla and Stéphane Wirtel.

files:
  Doc/library/sqlite3.rst |  34 +++++++++++++++++++++++++++-
  Misc/ACKS               |   1 +
  2 files changed, 33 insertions(+), 2 deletions(-)


diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -542,7 +542,7 @@
       .. literalinclude:: ../includes/sqlite3/execute_1.py
 
       :meth:`execute` will only execute a single SQL statement. If you try to execute
-      more than one statement with it, it will raise an ``sqlite3.Warning``. Use
+      more than one statement with it, it will raise an :exc:`.Warning`. Use
       :meth:`executescript` if you want to execute multiple SQL statements with one
       call.
 
@@ -605,7 +605,7 @@
 
       Close the cursor now (rather than whenever ``__del__`` is called).
 
-      The cursor will be unusable from this point forward; a ``ProgrammingError``
+      The cursor will be unusable from this point forward; a :exc:`ProgrammingError`
       exception will be raised if any operation is attempted with the cursor.
 
    .. attribute:: rowcount
@@ -719,6 +719,36 @@
    35.14
 
 
+.. _sqlite3-exceptions:
+
+Exceptions
+----------
+
+.. exception:: Warning
+
+   A subclass of :exc:`Exception`.
+
+.. exception:: Error
+
+   The base class of the other exceptions in this module.  It is a subclass
+   of :exc:`Exception`.
+
+.. exception:: DatabaseError
+
+   Exception raised for errors that are related to the database.
+
+.. exception:: IntegrityError
+
+   Exception raised when the relational integrity of the database is affected,
+   e.g. a foreign key check fails.  It is a subclass of :exc:`DatabaseError`.
+
+.. exception:: ProgrammingError
+
+   Exception raised for programming errors, e.g. table not found or already
+   exists, syntax error in the SQL statement, wrong number of parameters
+   specified, etc.  It is a subclass of :exc:`DatabaseError`.
+
+
 .. _sqlite3-types:
 
 SQLite and Python types
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1360,6 +1360,7 @@
 Alex Shkop
 Joel Shprentz
 Yue Shuaijie
+Jaysinh Shukla
 Terrel Shumway
 Eric Siegerman
 Paul Sijben

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list