From 9dc744b073b250e010be91895ab2e5760db6e45d Mon Sep 17 00:00:00 2001 From: n0npax Date: Sat, 7 Jul 2018 22:35:03 +0200 Subject: [PATCH 1/5] bpo-34061: Add missing docs for NotSupportedError in sqlite module --- Doc/library/sqlite3.rst | 6 ++++++ Misc/ACKS | 1 + 2 files changed, 7 insertions(+) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index efc74a6bab8ca5..5b0259f14e1bad 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -828,6 +828,12 @@ Exceptions disconnect occurs, the data source name is not found, a transaction could not be processed, etc. It is a subclass of :exc:`DatabaseError`. +.. exception:: NotSupportedError + + Exception raised in case a method or database API was used which is not + supported by the database, e.g. requesting a .rollback() on a connection + that does not support transaction or has transactions turned off. + It must be a subclass of :exc:`DatabaseError`. .. _sqlite3-types: diff --git a/Misc/ACKS b/Misc/ACKS index 25d1db078105bf..8e1b6f73d706cd 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1784,6 +1784,7 @@ Gordon Worley Darren Worrall Thomas Wouters Daniel Wozniak +Marcin Niemira Wei Wu Heiko Wundram Doug Wyatt From f55f6db572e67cf890c84989b2c4fd27268bedb2 Mon Sep 17 00:00:00 2001 From: n0npax Date: Sun, 8 Jul 2018 10:16:49 +0200 Subject: [PATCH 2/5] Fixes after CR bpo-34061/GH-8172 --- Doc/library/sqlite3.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 5b0259f14e1bad..5b7a7a29e545d7 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -831,9 +831,10 @@ Exceptions .. exception:: NotSupportedError Exception raised in case a method or database API was used which is not - supported by the database, e.g. requesting a .rollback() on a connection - that does not support transaction or has transactions turned off. - It must be a subclass of :exc:`DatabaseError`. + supported by the database, e.g. calling the :meth:`Connection.rollback` + on a connection that does not support transaction or has transactions + turned off. It is a subclass of :exc:`DatabaseError`. + .. _sqlite3-types: From 614131774dae0dc8871b7518c6397140540d3387 Mon Sep 17 00:00:00 2001 From: n0npax Date: Sun, 8 Jul 2018 12:32:04 +0200 Subject: [PATCH 3/5] Fixes after CR bpo-34061/GH-8172 --- Doc/library/sqlite3.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index cad7b09635b898..a003345726ed5d 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -838,9 +838,9 @@ Exceptions .. exception:: NotSupportedError Exception raised in case a method or database API was used which is not - supported by the database, e.g. calling the :meth:`Connection.rollback` - on a connection that does not support transaction or has transactions - turned off. It is a subclass of :exc:`DatabaseError`. + supported by the database, e.g. calling the :meth:`~Connection.rollback` + method on a connection that does not support transaction or has + transactions turned off. It is a subclass of :exc:`DatabaseError`. .. _sqlite3-types: From 0f0fc8e61c7ef34f758d51d060c310c24d1556e6 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sun, 8 Jul 2018 14:01:27 +0300 Subject: [PATCH 4/5] two spaces after full stops --- Doc/library/sqlite3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index a003345726ed5d..d70f6135c571f2 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -840,7 +840,7 @@ Exceptions Exception raised in case a method or database API was used which is not supported by the database, e.g. calling the :meth:`~Connection.rollback` method on a connection that does not support transaction or has - transactions turned off. It is a subclass of :exc:`DatabaseError`. + transactions turned off. It is a subclass of :exc:`DatabaseError`. .. _sqlite3-types: From 1f46c5bf135d9b9bee27515bfb5971d5eb3ea9f6 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Sun, 8 Jul 2018 14:31:36 +0300 Subject: [PATCH 5/5] link to NotSupportedError --- Doc/library/sqlite3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index d70f6135c571f2..37d2a4f50afda7 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -346,7 +346,7 @@ Connection Objects called as the SQL function. If *deterministic* is true, the created function is marked as `deterministic `_, which allows SQLite to perform additional optimizations. This flag is supported by - SQLite 3.8.3 or higher, ``sqlite3.NotSupportedError`` will be raised if used + SQLite 3.8.3 or higher, :exc:`NotSupportedError` will be raised if used with older versions. The function can return any of the types supported by SQLite: bytes, str, int,