Commit graph

109017 commits

Author SHA1 Message Date
Sam Gross
2a32dbf110
[3.9] bpo-45838: Fix incorrect line numbers in Tools/gdb/libpython.py (GH-29628)
The line number calculation in libpython.py did not properly handle
negative (signed) line table deltas.
2021-11-19 19:53:46 +01:00
Mark Shannon
4296396db0
[3.9] bpo-45806: Fix recovery from stack overflow for 3.9. Again. (GH-29640)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-19 19:51:50 +01:00
Miss Islington (bot)
c06c7c489a
[3.9] bpo-45788: Link sys.prefix doc to 'Installation paths' (GH-29606) (GH-29632)
... To the Installation paths section of the sysconfig doc.
(cherry picked from commit 4575c01b75)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-11-18 16:45:15 -05:00
Miss Islington (bot)
591bf41609
[3.9] [doc] bpo-45680: Disambiguate `__getitem__ and __class_getitem__` in the data model (GH-29389) (GH-29619)
The documentation explaining Python's data model does not adequately explain
the differences between ``__getitem__`` and ``__class_getitem__``, nor does it
explain when each is called. There is an attempt at explaining
``__class_getitem__`` in the documentation for ``GenericAlias`` objects, but
this does not give sufficient clarity into how the method works. Moreover, it
is the wrong place for that information to be found; the explanation of
``__class_getitem__`` should be in the documentation explaining the data model.

This PR has been split off from GH-29335.
(cherry picked from commit 31b3a70edb)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-18 18:41:09 +01:00
Miss Islington (bot)
9450c751cc
bpo-45835: Fix race condition in test_queue (GH-29601)
Some of the tests in test_queue had a race condition in which a
non-sentinel value could be enqueued after the final sentinel value
leading to not all the inputs being processed (and test failures).

This changes feed() to enqueue a sentinel once the inputs are exhausted,
which guarantees that the final queued object is a sentinel. This
requires the number of feeder threads to match the number of consumer
threads, but that's already the case in the relevant tests.
(cherry picked from commit df3e53d86b)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2021-11-18 08:16:06 -08:00
Miss Islington (bot)
71d842b9c1
bpo-29620: iterate over a copy of sys.modules (GH-4800) (GH-29605)
unittest.TestCase.assertWarns no longer raises a RuntimeException
when accessing a module's ``__warningregistry__`` causes importation of a new
module, or when a new module is imported in another thread.

Patch by Kernc.
(cherry picked from commit 46398fba4d)

Co-authored-by: kernc <kerncece@gmail.com>
2021-11-18 17:09:41 +01:00
Ethan Furman
feccea6a7e
[3.9] [Enum] update member.member removal (GH-29611)
Accessing one enum member from another originally raised an `AttributeError`, but became possible due to a performance boost implementation detail.  In 3.11 it will again raise an `AttributeError`.
2021-11-18 00:50:42 -08:00
Ethan Furman
d754073927
Revert "[3.9] [Enum] update member.member removal to 3.11 (GH-29607)" (GH-29609)
This reverts commit 41365f7dc4.
2021-11-17 23:40:08 -08:00
Ethan Furman
41365f7dc4
[3.9] [Enum] update member.member removal to 3.11 (GH-29607)
Accessing one enum member from another originally raised an `AttributeError`, but became possible due to a performance boost implementation detail.  In 3.11 it will again raise an `AttributeError`.
2021-11-17 23:36:01 -08:00
Miss Islington (bot)
17f5c5cad3
[docs] Add missing word "any" in unittest -k cmdline option description (GH-29571) (GH-29604)
(cherry picked from commit abc0d754c3)

Co-authored-by: ch33zer <ch33zer@gmail.com>
2021-11-18 01:26:12 +01:00
Miss Islington (bot)
00ee14e814
[3.9] bpo-45820: Fix a segfault when the parser fails without reading any input (GH-29580) (GH-29584)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-18 01:24:43 +01:00
Pablo Galindo Salgado
0ef308a289
bpo-45822: Respect PEP 263's coding cookies in the parser even if flags are not provided (GH-29582) (GH-29585)
(cherry picked from commit da20d7401d)
2021-11-18 00:18:16 +01:00
Sam Gross
87787c8774
[3.9] bpo-42540: reallocation of id_mutex should not force default allocator (GH-29564) (GH-29600)
Unlike the other locks reinitialized by _PyRuntimeState_ReInitThreads,
the "interpreters.main->id_mutex" is not freed by _PyRuntimeState_Fini
and should not force the default raw allocator..
(cherry picked from commit 736684b1bb)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2021-11-17 23:53:33 +01:00
Miss Islington (bot)
ac89f8cab7
bpo-45831: _Py_DumpASCII() uses a single write() call if possible (GH-29596) (GH-29597)
If the string is ASCII only and doesn't need to escape characters,
write the whole string with a single write() syscall.
(cherry picked from commit b919d8105c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-11-17 22:59:42 +01:00
Miss Islington (bot)
fd206b6807
[3.9] Save a reference for ensure_future and create_task (GH-29163) (GH-29573)
Co-authored-by: Joannah Nanjekye <jnanjekye@python.org>
(cherry picked from commit c750adbe69)


Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>

Automerge-Triggered-By: GH:asvetlov
2021-11-16 03:47:02 -08:00
Miss Islington (bot)
a40d066e8e
bpo-45677: Reword first section of sqlite3 docs (GH-29326) (GH-29567)
* bpo-45677: Avoid addressing the reader as 'you' in sqlite3 docs

* Adjust wording

* Adjust wording again

* Typo

* Update Doc/library/sqlite3.rst

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>

* Address review: adjust wording

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Lib/sqlite3/__init__.py

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Lib/sqlite3/__init__.py

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/library/sqlite3.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Apply Alex' suggestion, and apply 80 char limit to PR

* Minor adjustment

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit 6c5a312fb6)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-11-15 15:32:31 -08:00
Miss Islington (bot)
b0bdc093c2
bpo-25381: Update explanation of exceptions in C. (GH-26838) (GH-29569)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

(cherry picked from commit ad43dc0b54)
2021-11-15 18:07:58 -05:00
Łukasz Langa
3bb2566ce8
Post 3.9.9 2021-11-15 22:41:03 +01:00
Łukasz Langa
ccb0e6a345
Python 3.9.9 2021-11-15 18:43:00 +01:00
Miss Islington (bot)
32d14b262d
bpo-45220: Ensure RT_MANIFEST is defined when compiling Windows resource files (GH-29501)
(cherry picked from commit a56fbad85e)

Co-authored-by: Steve Dower <steve.dower@python.org>
2021-11-15 17:40:08 +00:00
Miss Islington (bot)
9f9a3028e3
bpo-45752: Remove "array" from list of things that cannot be copied in copy module docstring (GH-29555)
Automerge-Triggered-By: GH:asvetlov
(cherry picked from commit c2c4fdf5ea)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-11-14 05:21:32 -08:00
Miss Islington (bot)
6073920fcd
bpo-45752: Fix no-support examples in 'copy' docs (GH-29548)
(cherry picked from commit b7360ae395)

Co-authored-by: M. Mostafa Farzan <m2_farzan@yahoo.com>
2021-11-14 01:58:01 -08:00
Pablo Galindo Salgado
142fcb40b6
bpo-45738: Fix computation of error location for invalid continuation characters in the parser (GH-29550) (GH-29552)
(cherry picked from commit 25835c518a)
2021-11-14 01:47:27 +00:00
Jason R. Coombs
3e0b830e85
[3.9] [bpo-45765] Fix distribution discovery on empty path. (GH-29487). (GH-29511)
(cherry picked from commit 6ec0dec7b7)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2021-11-13 15:07:22 -05:00
Miss Islington (bot)
b952f60213
[3.9] bpo-45772: socket.socket should be a class instead of a function (GH-23960) (GH-29543)
* [bpo-45772](): socket.socket should be a class instead of a function

Currently `socket.socket` is documented as a function, but it is really
a class (and thus has function-like usage to construct an object). This
correction would ensure that Python projects that are interlinking
Python's documentation can properly locate `socket.socket` as a type.
(cherry picked from commit 4c792f39e6)


Co-authored-by: Hong Xu <hong@topbug.net>

Automerge-Triggered-By: GH:asvetlov
2021-11-12 22:29:01 -08:00
Miss Islington (bot)
587ff7f50b
bpo-45235: Revert an argparse bugfix that caused a regression (GH-29525) (GH-29531) 2021-11-12 12:44:25 -06:00
Miss Islington (bot)
8b6a474071
bpo-45792: Fix contextvar.Token's intersphinx FQN (GH-29533) (GH-29536)
Since `.. module:: contextvars` sets the module using `.. class:: contextvars.Token`, intersphinx records it as `contextvars.contextvars.Token`.
(cherry picked from commit e501d70b34)

Co-authored-by: Hynek Schlawack <hs@ox.cx>

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-11-12 12:20:20 +02:00
Steve Dower
4d1cdd7006
bpo-45732: Update bundled Tcl/Tk on Windows to 8.6.12 (GH-29477) 2021-11-09 19:12:56 +00:00
Miss Islington (bot)
80580f5ab8
bpo-40170: Update What's New in Python 3.9 (GH-29470) (GH-29472)
The PyType_HasFeature() change has been reverted: the static inline
function access directly the PyTypeObject.tp_flags member.
(cherry picked from commit 99c7e9853f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-11-08 18:10:41 +01:00
Miss Islington (bot)
6b0ea06ea8
remove the repeat 'the' (GH-29455)
(cherry picked from commit 122ca4d73f)

Co-authored-by: 180909 <734461790@qq.com>
2021-11-08 00:45:06 -08:00
Miss Islington (bot)
f5287ecd59
bpo-45392: Update the docstring of the 'type' built-in (GH-29439) (GH-29453)
(cherry picked from commit 9127520729)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2021-11-06 21:17:59 +01:00
Miss Islington (bot)
376218e1c6
bpo-27313: Use non-deprecated methods for tracing (GH-29425) (GH-29451)
(cherry picked from commit cc1cbcbb2d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-11-06 20:23:28 +01:00
Miss Islington (bot)
643f50ca5e
[doc] bpo-45680: Improve glossary entry for generic types (GH-29388) (GH-29448)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 77a2c77c84)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-11-06 19:50:18 +01:00
Miss Islington (bot)
a932631890
bpo-45644: Make json.tool read infile before writing to outfile (GH-29273) (GH-29446)
so that

$ python -m json.tool foo.json foo.json

doesn't result in an empty foo.json.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 815dad42d5)

Co-authored-by: Chris Wesseling <chris.wesseling@protonmail.com>
2021-11-06 19:01:44 +01:00
Miss Islington (bot)
5017306c87
bpo-45720: Drop references to shlwapi.dll on Windows (GH-29417)
(cherry picked from commit 804ea41211)

Co-authored-by: Steve Dower <steve.dower@python.org>

Co-authored-by: Steve Dower <steve.dower@python.org>
2021-11-06 01:38:50 +00:00
Łukasz Langa
5fdf7912ca
Post 3.9.8 2021-11-05 22:21:27 +01:00
Łukasz Langa
bb3fdcfe95
Python 3.9.8 2021-11-05 20:21:41 +01:00
Miss Islington (bot)
a8ae7a5613
bpo-45762: Improve docs for `@singledispatch/@singledispatchmethod` (GH-29426) (GH-29430)
(cherry picked from commit 71e8a3e76a)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-11-05 17:52:14 +01:00
Miss Islington (bot)
276a3a6a16
bpo-45160: Fix refleak in test_ttk_guionly introduced in GH-28291 (GH-29416) (GH-29420)
(cherry picked from commit 54d1e3f72e)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-05 11:00:05 +01:00
Miss Islington (bot)
885e57c148
bpo-27313: Fix ttk_guionly tests failing on Framework builds on macOS (GH-29411) (GH-29423)
(cherry picked from commit e52f9bee80)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-05 10:59:50 +01:00
Łukasz Langa
f701237db2
[3.9] bpo-30570: Fix segfault on buildbots caused by stack overflow from recursion in tests (GH-29258) (GH-29415)
(cherry picked from commit d56375a0dd)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2021-11-04 21:52:26 +01:00
Miss Islington (bot)
1e29dce113
bpo-30570: Use Py_EnterRecursiveCall() in issubclass() (GH-29048) (GH-29178)
* Use Py_EnterRecursiveCall() in issubclass()

Reviewed-by: Gregory P. Smith <greg@krypto.org> [Google]
(cherry picked from commit 423fa1c181)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2021-11-04 21:20:21 +01:00
Alex Waygood
effb72fa0f
[3.9] bpo-45678: Fix singledispatchmethod classmethod/staticmethod bug (GH-29394)
This PR fixes a bug in the 3.9 branch where
``functools.singledispatchmethod`` did not properly wrap attributes such as
``__name__``, ``__doc__`` and ``__module__`` of the target method. It also
backports tests already merged into the 3.11 and 3.10 branches in #29328 and
#29390.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-04 20:34:14 +01:00
Miss Islington (bot)
9a4604bf03
Add generated artifacts in Mac/ to .gitignore; update copyright (GH-29408) (GH-29410)
(cherry picked from commit 3167df1621)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-11-04 20:31:39 +01:00
Miss Islington (bot)
1a44d27e6f
bpo-45220: Remove invalid include from resource definition files on Windows (GH-29396)
(cherry picked from commit fd0c84dc28)

Co-authored-by: Steve Dower <steve.dower@python.org>
2021-11-04 10:01:19 -07:00
Miss Islington (bot)
7e244fc804
Remove reference to `Tuple at top of typing` docs (GH-29401)
``typing.Tuple`` has been deprecated since Python 3.9, so it makes no sense to mention it so prominently in the documentation for the ``typing`` module.
(cherry picked from commit 87032cfa3d)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-11-04 05:13:24 -07:00
Miss Islington (bot)
e813dd4d7b
bpo-45680: `typing docs: improve links to docs on GenericAlias/__class_getitem__` (GH-29387)
(cherry picked from commit e03e50377d)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2021-11-03 21:34:31 -07:00
Łukasz Langa
8198617bcc
[3.9] bpo-45578: add tests for dis.distb (GH-29332) (#29386)
(cherry picked from commit e346f19681)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2021-11-03 17:47:04 +01:00
Miss Islington (bot)
3a93c669f5
bpo-45633: Fix newtypes doc typo (GH-29318) (GH-29365)
(cherry picked from commit 454cdb99ab)

Co-authored-by: Dmitry Smirnov <dmitrysmirnov931@gmail.com>
2021-11-03 17:30:59 +08:00
Serhiy Storchaka
bbcf06bf95
[3.9] bpo-45679: Fix caching of multi-value typing.Literal (GH-29334) (GH-29342)
Literal[True, 2] is no longer equal to Literal[1, 2]..
(cherry picked from commit 634984d7db)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-11-03 17:28:55 +08:00