Skip to content

Commit

Permalink
Merge branch 'main' into inlinecomp2
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
carljm committed Feb 10, 2023
2 parents b87d209 + 61f2be0 commit 36b2917
Show file tree
Hide file tree
Showing 17 changed files with 278 additions and 370 deletions.
2 changes: 1 addition & 1 deletion Doc/library/http.client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ statement.
.. deprecated:: 3.9
Deprecated in favor of :attr:`~HTTPResponse.headers`.

.. method:: HTTPResponse.getstatus()
.. method:: HTTPResponse.getcode()

.. deprecated:: 3.9
Deprecated in favor of :attr:`~HTTPResponse.status`.
Expand Down
45 changes: 33 additions & 12 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1418,15 +1418,22 @@ Cursor objects

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

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

:meth:`execute` will only execute a single SQL statement. If you try to execute
more than one statement with it, it will raise a :exc:`ProgrammingError`. Use
:meth:`executescript` if you want to execute multiple SQL statements with one
call.
:param str sql:
A single SQL statement.

:param parameters:
Python values to bind to placeholders in *sql*.
A :class:`!dict` if named placeholders are used.
A :term:`!sequence` if unnamed placeholders are used.
See :ref:`sqlite3-placeholders`.
:type parameters: :class:`dict` | :term:`sequence`

:raises ProgrammingError:
If *sql* contains more than one SQL statement.

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

Use :meth:`executescript` to execute multiple SQL statements.

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

Execute :ref:`parameterized <sqlite3-placeholders>` SQL statement *sql*
against all parameter sequences or mappings found in the sequence
*parameters*. It is also possible to use an
:term:`iterator` yielding parameters instead of a sequence.
For every item in *parameters*,
repeatedly execute the :ref:`parameterized <sqlite3-placeholders>`
SQL statement *sql*.

Uses the same implicit transaction handling as :meth:`~Cursor.execute`.

:param str sql:
A single SQL :abbr:`DML (Data Manipulation Language)` statement.

:param parameters:
An :term:`!iterable` of parameters to bind with
the placeholders in *sql*.
See :ref:`sqlite3-placeholders`.
:type parameters: :term:`iterable`

:raises ProgrammingError:
If *sql* contains more than one SQL statement,
or is not a DML statment.

Example:

.. testcode:: sqlite3.cursor
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/urllib.request.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,7 @@ The typical response object is a :class:`urllib.response.addinfourl` instance:
.. deprecated:: 3.9
Deprecated in favor of :attr:`~addinfourl.status`.

.. method:: getstatus()
.. method:: getcode()

.. deprecated:: 3.9
Deprecated in favor of :attr:`~addinfourl.status`.
7 changes: 4 additions & 3 deletions Lib/bdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,10 @@ def format_stack_entry(self, frame_lineno, lprefix=': '):
rv = frame.f_locals['__return__']
s += '->'
s += reprlib.repr(rv)
line = linecache.getline(filename, lineno, frame.f_globals)
if line:
s += lprefix + line.strip()
if lineno is not None:
line = linecache.getline(filename, lineno, frame.f_globals)
if line:
s += lprefix + line.strip()
return s

# The following methods can be called by clients to use
Expand Down
6 changes: 6 additions & 0 deletions Lib/test/test_bdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1203,5 +1203,11 @@ def main():
tracer.runcall(tfunc_import)


class TestRegressions(unittest.TestCase):
def test_format_stack_entry_no_lineno(self):
# See gh-101517
Bdb().format_stack_entry((sys._getframe(), None))


if __name__ == "__main__":
unittest.main()
6 changes: 3 additions & 3 deletions Mac/BuildScript/build-installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ def library_recipes():
),
),
dict(
name="SQLite 3.39.4",
url="https://sqlite.org/2022/sqlite-autoconf-3390400.tar.gz",
checksum="44b7e6691b0954086f717a6c43b622a5",
name="SQLite 3.40.1",
url="https://sqlite.org/2022/sqlite-autoconf-3400100.tar.gz",
checksum="5498af3a357753d473ee713e363fa5b7",
extra_cflags=('-Os '
'-DSQLITE_ENABLE_FTS5 '
'-DSQLITE_ENABLE_FTS4 '
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove global state from :mod:`itertools` module (:pep:`687`). Patches by
Erlend E. Aasland.
Original file line number Diff line number Diff line change
@@ -0,0 +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.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update Windows installer to SQLite 3.40.1.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updates copy of libffi bundled with Windows installs to 3.4.4.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update macOS installer to SQLite 3.40.1.
6 changes: 3 additions & 3 deletions Modules/clinic/itertoolsmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 36b2917

Please sign in to comment.