From d9a67968a80726bde92b0115cebef8f2f7ee9402 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Thu, 5 Jun 2025 09:51:36 +0200 Subject: [PATCH 1/2] Docs: amend sqlite3 execute*() deprecation notes --- Doc/library/sqlite3.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 2d0f9a740c685a..310767c9559c54 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -1482,7 +1482,9 @@ Cursor objects :type parameters: :class:`dict` | :term:`sequence` :raises ProgrammingError: - If *sql* contains more than one SQL statement. + When *sql* contains more than one SQL statement. + When :ref:`named placeholders ` are used + and *parameters* is a sequence instead of a :class:`dict`. If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, @@ -1491,13 +1493,11 @@ Cursor objects and there is no open transaction, a transaction is implicitly opened before executing *sql*. - .. deprecated-removed:: 3.12 3.14 + .. changed:: 3.14 - :exc:`DeprecationWarning` is emitted if + :exc:`ProgrammingError` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:`dict`. - Starting with Python 3.14, :exc:`ProgrammingError` will - be raised instead. Use :meth:`executescript` to execute multiple SQL statements. @@ -1519,8 +1519,10 @@ Cursor objects :type parameters: :term:`iterable` :raises ProgrammingError: - If *sql* contains more than one SQL statement, - or is not a DML statement. + When *sql* contains more than one SQL statement + or is not a DML statement, + When :ref:`named placeholders ` are used + and the items in *parameters* are sequences instead of :class:`dict`\s. Example: @@ -1544,14 +1546,12 @@ Cursor objects .. _RETURNING clauses: https://www.sqlite.org/lang_returning.html - .. deprecated-removed:: 3.12 3.14 + .. changed:: 3.14 - :exc:`DeprecationWarning` is emitted if + :exc:`ProgrammingError` is emitted if :ref:`named placeholders ` are used and the items in *parameters* are sequences instead of :class:`dict`\s. - Starting with Python 3.14, :exc:`ProgrammingError` will - be raised instead. .. method:: executescript(sql_script, /) From d2d54f03bff6f55539c4db22e634d45793e989a1 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Thu, 5 Jun 2025 09:57:30 +0200 Subject: [PATCH 2/2] Typo --- Doc/library/sqlite3.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 310767c9559c54..12761baf792a6b 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -1493,7 +1493,7 @@ Cursor objects and there is no open transaction, a transaction is implicitly opened before executing *sql*. - .. changed:: 3.14 + .. versionchanged:: 3.14 :exc:`ProgrammingError` is emitted if :ref:`named placeholders ` are used @@ -1546,7 +1546,7 @@ Cursor objects .. _RETURNING clauses: https://www.sqlite.org/lang_returning.html - .. changed:: 3.14 + .. versionchanged:: 3.14 :exc:`ProgrammingError` is emitted if :ref:`named placeholders ` are used