Skip to content

Commit 36b2917

Browse files
committed
Merge branch 'main' into inlinecomp2
* main: Docs: Fix getstatus() -> getcode() typos (python#101296) Docs: use parameter list for sqlite3.Cursor.execute* (python#101782) pythongh-101763: Update bundled copy of libffi to 3.4.4 on Windows (pythonGH-101784) pythongh-101517: make bdb avoid looking up in linecache with lineno=None (python#101787) pythongh-101759: Update Windows installer to SQLite 3.40.1 (python#101762) pythongh-101277: Finalise isolating itertools (pythonGH-101305) pythongh-101759: Update macOS installer to SQLite 3.40.1 (python#101761)
2 parents b87d209 + 61f2be0 commit 36b2917

17 files changed

Lines changed: 278 additions & 370 deletions

Doc/library/http.client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ statement.
532532
.. deprecated:: 3.9
533533
Deprecated in favor of :attr:`~HTTPResponse.headers`.
534534

535-
.. method:: HTTPResponse.getstatus()
535+
.. method:: HTTPResponse.getcode()
536536

537537
.. deprecated:: 3.9
538538
Deprecated in favor of :attr:`~HTTPResponse.status`.

Doc/library/sqlite3.rst

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,15 +1418,22 @@ Cursor objects
14181418

14191419
.. method:: execute(sql, parameters=(), /)
14201420

1421-
Execute SQL statement *sql*.
1422-
Bind values to the statement using :ref:`placeholders
1423-
<sqlite3-placeholders>` that map to the :term:`sequence` or :class:`dict`
1424-
*parameters*.
1421+
Execute SQL a single SQL statement,
1422+
optionally binding Python values using
1423+
:ref:`placeholders <sqlite3-placeholders>`.
14251424

1426-
:meth:`execute` will only execute a single SQL statement. If you try to execute
1427-
more than one statement with it, it will raise a :exc:`ProgrammingError`. Use
1428-
:meth:`executescript` if you want to execute multiple SQL statements with one
1429-
call.
1425+
:param str sql:
1426+
A single SQL statement.
1427+
1428+
:param parameters:
1429+
Python values to bind to placeholders in *sql*.
1430+
A :class:`!dict` if named placeholders are used.
1431+
A :term:`!sequence` if unnamed placeholders are used.
1432+
See :ref:`sqlite3-placeholders`.
1433+
:type parameters: :class:`dict` | :term:`sequence`
1434+
1435+
:raises ProgrammingError:
1436+
If *sql* contains more than one SQL statement.
14301437

14311438
If :attr:`~Connection.autocommit` is
14321439
:data:`LEGACY_TRANSACTION_CONTROL`,
@@ -1435,15 +1442,29 @@ Cursor objects
14351442
and there is no open transaction,
14361443
a transaction is implicitly opened before executing *sql*.
14371444

1445+
Use :meth:`executescript` to execute multiple SQL statements.
14381446

14391447
.. method:: executemany(sql, parameters, /)
14401448

1441-
Execute :ref:`parameterized <sqlite3-placeholders>` SQL statement *sql*
1442-
against all parameter sequences or mappings found in the sequence
1443-
*parameters*. It is also possible to use an
1444-
:term:`iterator` yielding parameters instead of a sequence.
1449+
For every item in *parameters*,
1450+
repeatedly execute the :ref:`parameterized <sqlite3-placeholders>`
1451+
SQL statement *sql*.
1452+
14451453
Uses the same implicit transaction handling as :meth:`~Cursor.execute`.
14461454

1455+
:param str sql:
1456+
A single SQL :abbr:`DML (Data Manipulation Language)` statement.
1457+
1458+
:param parameters:
1459+
An :term:`!iterable` of parameters to bind with
1460+
the placeholders in *sql*.
1461+
See :ref:`sqlite3-placeholders`.
1462+
:type parameters: :term:`iterable`
1463+
1464+
:raises ProgrammingError:
1465+
If *sql* contains more than one SQL statement,
1466+
or is not a DML statment.
1467+
14471468
Example:
14481469

14491470
.. testcode:: sqlite3.cursor

Doc/library/urllib.request.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ The typical response object is a :class:`urllib.response.addinfourl` instance:
16301630
.. deprecated:: 3.9
16311631
Deprecated in favor of :attr:`~addinfourl.status`.
16321632

1633-
.. method:: getstatus()
1633+
.. method:: getcode()
16341634

16351635
.. deprecated:: 3.9
16361636
Deprecated in favor of :attr:`~addinfourl.status`.

Lib/bdb.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,10 @@ def format_stack_entry(self, frame_lineno, lprefix=': '):
570570
rv = frame.f_locals['__return__']
571571
s += '->'
572572
s += reprlib.repr(rv)
573-
line = linecache.getline(filename, lineno, frame.f_globals)
574-
if line:
575-
s += lprefix + line.strip()
573+
if lineno is not None:
574+
line = linecache.getline(filename, lineno, frame.f_globals)
575+
if line:
576+
s += lprefix + line.strip()
576577
return s
577578

578579
# The following methods can be called by clients to use

Lib/test/test_bdb.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,5 +1203,11 @@ def main():
12031203
tracer.runcall(tfunc_import)
12041204

12051205

1206+
class TestRegressions(unittest.TestCase):
1207+
def test_format_stack_entry_no_lineno(self):
1208+
# See gh-101517
1209+
Bdb().format_stack_entry((sys._getframe(), None))
1210+
1211+
12061212
if __name__ == "__main__":
12071213
unittest.main()

Mac/BuildScript/build-installer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,9 @@ def library_recipes():
359359
),
360360
),
361361
dict(
362-
name="SQLite 3.39.4",
363-
url="https://sqlite.org/2022/sqlite-autoconf-3390400.tar.gz",
364-
checksum="44b7e6691b0954086f717a6c43b622a5",
362+
name="SQLite 3.40.1",
363+
url="https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz",
364+
checksum="5498af3a357753d473ee713e363fa5b7",
365365
extra_cflags=('-Os '
366366
'-DSQLITE_ENABLE_FTS5 '
367367
'-DSQLITE_ENABLE_FTS4 '
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Remove global state from :mod:`itertools` module (:pep:`687`). Patches by
2+
Erlend E. Aasland.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed bug where :mod:`bdb` looks up the source line with :mod:`linecache` with a ``lineno=None``, which causes it to fail with an unhandled exception.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update Windows installer to SQLite 3.40.1.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updates copy of libffi bundled with Windows installs to 3.4.4.

0 commit comments

Comments
 (0)