gh-118928: Amend sqlite3 execute*() deprecation notes (#135163)

This commit is contained in:
Erlend E. Aasland 2025-06-10 13:24:33 +02:00 committed by GitHub
parent c23eec2960
commit ee7345d507
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1482,7 +1482,9 @@ Cursor objects
:type parameters: :class:`dict` | :term:`sequence` :type parameters: :class:`dict` | :term:`sequence`
:raises ProgrammingError: :raises ProgrammingError:
If *sql* contains more than one SQL statement. When *sql* contains more than one SQL statement.
When :ref:`named placeholders <sqlite3-placeholders>` are used
and *parameters* is a sequence instead of a :class:`dict`.
If :attr:`~Connection.autocommit` is If :attr:`~Connection.autocommit` is
:data:`LEGACY_TRANSACTION_CONTROL`, :data:`LEGACY_TRANSACTION_CONTROL`,
@ -1491,13 +1493,11 @@ Cursor objects
and there is no open transaction, and there is no open transaction,
a transaction is implicitly opened before executing *sql*. a transaction is implicitly opened before executing *sql*.
.. deprecated-removed:: 3.12 3.14 .. versionchanged:: 3.14
:exc:`DeprecationWarning` is emitted if :exc:`ProgrammingError` is emitted if
:ref:`named placeholders <sqlite3-placeholders>` are used :ref:`named placeholders <sqlite3-placeholders>` are used
and *parameters* is a sequence instead of a :class:`dict`. 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. Use :meth:`executescript` to execute multiple SQL statements.
@ -1519,8 +1519,10 @@ Cursor objects
:type parameters: :term:`iterable` :type parameters: :term:`iterable`
:raises ProgrammingError: :raises ProgrammingError:
If *sql* contains more than one SQL statement, When *sql* contains more than one SQL statement
or is not a DML statement. or is not a DML statement,
When :ref:`named placeholders <sqlite3-placeholders>` are used
and the items in *parameters* are sequences instead of :class:`dict`\s.
Example: Example:
@ -1544,14 +1546,12 @@ Cursor objects
.. _RETURNING clauses: https://www.sqlite.org/lang_returning.html .. _RETURNING clauses: https://www.sqlite.org/lang_returning.html
.. deprecated-removed:: 3.12 3.14 .. versionchanged:: 3.14
:exc:`DeprecationWarning` is emitted if :exc:`ProgrammingError` is emitted if
:ref:`named placeholders <sqlite3-placeholders>` are used :ref:`named placeholders <sqlite3-placeholders>` are used
and the items in *parameters* are sequences and the items in *parameters* are sequences
instead of :class:`dict`\s. instead of :class:`dict`\s.
Starting with Python 3.14, :exc:`ProgrammingError` will
be raised instead.
.. method:: executescript(sql_script, /) .. method:: executescript(sql_script, /)