]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years ago[3.12] gh-109015: Add test.support.socket_helper.tcp_blackhole() (GH-109016) (#109041)
Miss Islington (bot) [Fri, 8 Sep 2023 13:12:29 +0000 (06:12 -0700)] 
[3.12] gh-109015: Add test.support.socket_helper.tcp_blackhole() (GH-109016) (#109041)

gh-109015: Add test.support.socket_helper.tcp_blackhole() (GH-109016)

Skip test_asyncio, test_imaplib and test_socket tests if FreeBSD TCP
blackhole is enabled (net.inet.tcp.blackhole=2).
(cherry picked from commit a52a3509770f29f940cda9307704908949912276)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] Docs: Fix typo in datetime.tzinfo docstring (GH-107257) (#109032)
Miss Islington (bot) [Fri, 8 Sep 2023 13:11:32 +0000 (06:11 -0700)] 
[3.12] Docs: Fix typo in datetime.tzinfo docstring (GH-107257) (#109032)

Docs: Fix typo in datetime.tzinfo docstring (GH-107257)
(cherry picked from commit 60a9eea3f56c002356998f5532b3ad870a1ffa8e)

Co-authored-by: Mikhail Samylov <Samylov-Mikhail@yandex.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] GH-108202: Document ``calendar``'s command-line interface (GH-109020) (#109030)
Miss Islington (bot) [Fri, 8 Sep 2023 13:11:16 +0000 (06:11 -0700)] 
[3.12] GH-108202: Document ``calendar``'s command-line interface (GH-109020) (#109030)

GH-108202: Document ``calendar``'s command-line interface (GH-109020)
(cherry picked from commit f0f96a9f40762499811681d405b6f922b6ed7a55)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] GH-90690: Mention removal of ``PRECALL`` in What's New (GH-103910) (#109027)
Miss Islington (bot) [Fri, 8 Sep 2023 13:10:18 +0000 (06:10 -0700)] 
[3.12] GH-90690: Mention removal of ``PRECALL`` in What's New (GH-103910) (#109027)

GH-90690: Mention removal of ``PRECALL`` in What's New (GH-103910)
(cherry picked from commit f9bd6e49ae58e0ba2934f29dd0f3299ba844cc8d)

Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] C API tests: use special markers to test that output parameters were set ...
Serhiy Storchaka [Fri, 8 Sep 2023 13:09:49 +0000 (16:09 +0300)] 
[3.12] C API tests: use special markers to test that output parameters were set (GH-109014) (#109023)

[3.12] C API tests: use special markers to test that output parameters were set (GH-109014).
(cherry picked from commit bf414b7fcb7c8ba780a5e1d9f320ecef0c7f9488)

2 years ago[3.12] gh-109002: Ensure only one wheel for each vendored package (GH-109003) (#109005)
Miss Islington (bot) [Wed, 6 Sep 2023 18:01:36 +0000 (11:01 -0700)] 
[3.12] gh-109002: Ensure only one wheel for each vendored package (GH-109003) (#109005)

Output with one wheel:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
Verifying checksum for /Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl.
Expected digest: 7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be
Actual digest:   7ccf472345f20d35bdc9d1841ff5f313260c2c33fe417f48c30ac46cccabf5be
::notice file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl::Successfully verified the checksum of the pip wheel.
```

Output with two wheels:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
::error file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-22.0.4-py3-none-any.whl::Found more than one wheel for package pip.

::error file=/Volumes/RAMDisk/cpython/Lib/ensurepip/_bundled/pip-23.2.1-py3-none-any.whl::Found more than one wheel for package pip.
```

Output without wheels:
```
❯ GITHUB_ACTIONS=true ./Tools/build/verify_ensurepip_wheels.py
::error file=::Could not find a pip wheel on disk.
```
(cherry picked from commit f8a047941f2e4a1848700c21d58a08c9ec6a9c68)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2 years agoMerge branch '3.12' of https://github.com/python/cpython into 3.12
Thomas Wouters [Wed, 6 Sep 2023 10:28:46 +0000 (12:28 +0200)] 
Merge branch '3.12' of https://github.com/python/cpython into 3.12

2 years agoPost 3.12.0rc2
Thomas Wouters [Wed, 6 Sep 2023 10:27:54 +0000 (12:27 +0200)] 
Post 3.12.0rc2

2 years ago[3.12] gh-108857: improve markup in inspect.Signature.replace() docs (GH-108862)...
Miss Islington (bot) [Wed, 6 Sep 2023 00:39:21 +0000 (17:39 -0700)] 
[3.12] gh-108857: improve markup in inspect.Signature.replace() docs (GH-108862) (#108971)

gh-108857: improve markup in inspect.Signature.replace() docs (GH-108862)
(cherry picked from commit 6f8411cfd68134ccae01b0b4cb332578008a69e3)

Co-authored-by: nabin2004 <107109731+nabin2004@users.noreply.github.com>
2 years agoPython 3.12.0rc2 v3.12.0rc2
Thomas Wouters [Tue, 5 Sep 2023 21:55:58 +0000 (23:55 +0200)] 
Python 3.12.0rc2

2 years ago[3.12] gh-108469: Update ast.unparse for unescaped quote support from PEP701 [3.12...
Miss Islington (bot) [Tue, 5 Sep 2023 20:49:55 +0000 (13:49 -0700)] 
[3.12] gh-108469: Update ast.unparse for unescaped quote support from PEP701 [3.12] (GH-108553) (#108960)

Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
2 years ago[3.12] gh-108927: Fix test_import + test_importlib + test_unittest problem (GH-108929...
Miss Islington (bot) [Tue, 5 Sep 2023 20:43:47 +0000 (13:43 -0700)] 
[3.12] gh-108927: Fix test_import + test_importlib + test_unittest problem (GH-108929) (#108954)

gh-108927: Fix test_import + test_importlib + test_unittest problem (GH-108929)
(cherry picked from commit 3f89b257639dd817a32079da2ae2c4436b8e82eb)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-107565: Update Windows build to use OpenSSL 3.0.10 (GH-108928) (#108930)
Miss Islington (bot) [Tue, 5 Sep 2023 18:19:06 +0000 (11:19 -0700)] 
[3.12] gh-107565: Update Windows build to use OpenSSL 3.0.10 (GH-108928) (#108930)

gh-107565: Update Windows build to use OpenSSL 3.0.10 (GH-108928)
(cherry picked from commit deea7c82682848b2a0db971a4dcc3a32c73a9f8c)

Co-authored-by: Zachary Ware <zach@python.org>
2 years ago[3.12] GH-103082: Document PEP-669: Low Impact Monitoring for CPython (GH-107772...
Miss Islington (bot) [Tue, 5 Sep 2023 13:07:11 +0000 (06:07 -0700)] 
[3.12] GH-103082: Document PEP-669: Low Impact Monitoring for CPython (GH-107772) (#108909)

GH-103082: Document PEP-669: Low Impact Monitoring for CPython (GH-107772)
(cherry picked from commit 8b515f60ee1dec65cb3d64f1cc1d4b32aa2f4184)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2 years ago[3.12] GH-108390: Prevent non-local events being set with `sys.monitoring.set_local_e...
Mark Shannon [Tue, 5 Sep 2023 11:29:38 +0000 (12:29 +0100)] 
[3.12] GH-108390: Prevent non-local events being set with `sys.monitoring.set_local_events()` (GH-108420) (#108899)

* GH-108390: Prevent non-local events being set with `sys.monitoring.set_local_events()` (GH-108420)

* Restore generated objects

* Restore size of monitoring arrays in code object for 3.12 ABI compatibility.

* Update ABI file

2 years ago[3.12] gh-89392: Remove support of test_main() in libregrtest (GH-108876) (#108897)
Serhiy Storchaka [Tue, 5 Sep 2023 11:18:41 +0000 (14:18 +0300)] 
[3.12] gh-89392: Remove support of test_main() in libregrtest (GH-108876) (#108897)

[3.12] gh-89392: Remove support of test_main() in libregrtest (GH-108876).
(cherry picked from commit 04a0830b00879efe057e3dfe75e9aa9c0caf1a26)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years ago[3.12] Link to PEP sections in What's New in 3.12 (GH-108878) (#108890)
Miss Islington (bot) [Tue, 5 Sep 2023 10:52:36 +0000 (03:52 -0700)] 
[3.12] Link to PEP sections in What's New in 3.12 (GH-108878) (#108890)

Link to PEP sections in What's New in 3.12 (GH-108878)
(cherry picked from commit 7855d325e638a4b7f7b40f2c35dc80de82d8fe70)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] bpo-45229: Make ElementTree tests discoverable (GH-108859) (#108873)
Serhiy Storchaka [Tue, 5 Sep 2023 10:51:37 +0000 (13:51 +0300)] 
[3.12] bpo-45229: Make ElementTree tests discoverable (GH-108859) (#108873)

[3.12] bpo-45229: Make ElementTree tests discoverable (GH-108859).
(cherry picked from commit 074ac1f72e392a576516639f650bac0519d1cb52)

2 years ago[3.12] CI: Bump GitHub Actions (GH-108879) (#108889)
Miss Islington (bot) [Tue, 5 Sep 2023 10:50:44 +0000 (03:50 -0700)] 
[3.12] CI: Bump GitHub Actions (GH-108879) (#108889)

CI: Bump GitHub Actions (GH-108879)
(cherry picked from commit 572678e1f864cb042df6962848a436d84ef7a8a4)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] gh-89392: Remove test_main() in test_netrc (GH-108860) (#108872)
Serhiy Storchaka [Mon, 4 Sep 2023 19:13:02 +0000 (22:13 +0300)] 
[3.12] gh-89392: Remove test_main() in test_netrc (GH-108860) (#108872)

[3.12] gh-89392: Remove test_main() in test_netrc (GH-108860).
(cherry picked from commit 76f3c043b6c5971d5a13fc6decf87a80ddf7ef95)

Co-authored-by: T. Wouters <thomas@python.org>
2 years ago[3.12] Disable `differing_test_runners` health check (GH-108886) (#108887)
Miss Islington (bot) [Mon, 4 Sep 2023 19:11:16 +0000 (12:11 -0700)] 
[3.12] Disable `differing_test_runners` health check (GH-108886) (#108887)

Disable `differing_test_runners` health check (GH-108886)
(cherry picked from commit 6ead5bd6ae20b902e6c11a3c0acede22632dc0d5)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-89392: Make test_pep646_syntax discoverable (GH-108861) (#108871)
Serhiy Storchaka [Mon, 4 Sep 2023 16:41:42 +0000 (19:41 +0300)] 
[3.12] gh-89392: Make test_pep646_syntax discoverable (GH-108861) (#108871)

* [3.12] gh-89392: Make test_pep646_syntax discoverable (GH-108861).
(cherry picked from commit d0b22f6bd84239e50b43709f98f2bb950222cfe5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Add "import unittest".

2 years ago[3.12] Resolve reference warnings in faq/gui.rst (GH-108147) (#108193)
Miss Islington (bot) [Mon, 4 Sep 2023 16:40:59 +0000 (09:40 -0700)] 
[3.12] Resolve reference warnings in faq/gui.rst (GH-108147) (#108193)

* Resolve reference warnings in faq/gui.rst (GH-108147)
(cherry picked from commit 8f3d09bf5d16b508fece5420a22abe6f0c1f00b7)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Resolve reference warnings in faq/gui.rst

---------

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] gh-46376: Revert "Return existing pointer when possible in ctypes (GH-107131...
Łukasz Langa [Mon, 4 Sep 2023 14:24:16 +0000 (16:24 +0200)] 
[3.12] gh-46376: Revert "Return existing pointer when possible in ctypes (GH-107131) (GH-107487)" (#108864)

This reverts commit 54aaaadef8a44324f6be674707c67a3516470ff6.

Co-authored-by: T. Wouters <thomas@python.org>
2 years ago[3.12] Reorder some test's decorators (GH-108804) (#108844)
Miss Islington (bot) [Mon, 4 Sep 2023 11:47:07 +0000 (04:47 -0700)] 
[3.12] Reorder some test's decorators (GH-108804) (#108844)

Reorder some test's decorators (GH-108804)

For example, do not demand the 'cpu' resource if the test cannot be run
due to non-working threads.
(cherry picked from commit 509bb61977cc8a4487efd3f9cdd63d9f7b86be62)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-107208: Fix iter_index() recipe to not swallow exceptions (gh-108835) ...
Miss Islington (bot) [Mon, 4 Sep 2023 11:46:35 +0000 (04:46 -0700)] 
[3.12] gh-107208: Fix iter_index() recipe to not swallow exceptions (gh-108835) (#108837)

gh-107208: Fix iter_index() recipe to not swallow exceptions (gh-108835)
(cherry picked from commit f373c6b9483e12d7f6e03a631601149ed60ab883)

gh-107208: iter_index now supports "stop" and no longer swallows ValueError

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2 years ago[3.12] gh-108822: regrtest computes statistics (#108793) (#108833)
Victor Stinner [Mon, 4 Sep 2023 11:45:50 +0000 (13:45 +0200)] 
[3.12] gh-108822: regrtest computes statistics (#108793) (#108833)

gh-108822: regrtest computes statistics (#108793)

test_netrc, test_pep646_syntax and test_xml_etree now return results
in the test_main() function.

Changes:

* Rewrite TestResult as a dataclass with a new State class.
* Add test.support.TestStats class and Regrtest.stats_dict attribute.
* libregrtest.runtest functions now modify a TestResult instance
  in-place.
* libregrtest summary lists the number of run tests and skipped
  tests, and denied resources.
* Add TestResult.has_meaningful_duration() method.
* Compute TestResult duration in the upper function.
* Use time.perf_counter() instead of time.monotonic().
* Regrtest: rename 'resource_denieds' attribute to 'resource_denied'.
* Rename CHILD_ERROR to MULTIPROCESSING_ERROR.
* Use match/case syntadx to have different code depending on the
  test state.

Notes on the backport: doctest.TestResults.skipped is a new feature
in Python 3.13, so don't use it in the backport.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit d4e534cbb35678c82b3a1276826af55d7bfc23b6)

2 years ago[3.12] gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421...
Miss Islington (bot) [Sat, 2 Sep 2023 23:22:33 +0000 (16:22 -0700)] 
[3.12] gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421) (#108798)

gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421)

Only mark tests which spend significant system or user time,
by itself or in subprocesses.
(cherry picked from commit f3ba0a74cd50274acdcd592d4ce8395b92492b7c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-63760: Don't declare gethostname() on Solaris (#108817) (#108824)
Victor Stinner [Sat, 2 Sep 2023 21:47:25 +0000 (23:47 +0200)] 
[3.12] gh-63760: Don't declare gethostname() on Solaris (#108817) (#108824)

gh-63760: Don't declare gethostname() on Solaris (#108817)

Since 2005, Solaris defines gethostname(). socketmodule.c no longer
has to define gethostname() for Solaris.

Oracle Solaris and OpenSolaris have patches to remove the
gethostname() definition in Python:

* https://github.com/oracle/solaris-userland/blob/master/components/python/python37/patches/15-gethostname.patch
* https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/python/python37/patches/15-gethostname.patch
* https://github.com/omniosorg/omnios-build/blob/master/build/python27/patches/24-gethostname.patch

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
(cherry picked from commit 0e6d582b3b73a88e71cae04327b31a1ee203722c)

2 years ago[3.12] gh-101100: Fix sphinx warnings in `unittest.mock-examples.rst` (GH-108810...
Nikita Sobolev [Sat, 2 Sep 2023 21:46:03 +0000 (00:46 +0300)] 
[3.12] gh-101100: Fix sphinx warnings in `unittest.mock-examples.rst` (GH-108810) (#108813)

* [3.12] gh-101100: Fix sphinx warnings in `unittest.mock-examples.rst` (GH-108810).
(cherry picked from commit 5141b1ebe07ad54279e0770b4704eaf76f24951d)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* Make the requested changes

---------

Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2 years ago[3.12] gh-101100: Fix sphinx warnings in `uuid.rst` (GH-108805) (#108807)
Miss Islington (bot) [Sat, 2 Sep 2023 21:45:40 +0000 (14:45 -0700)] 
[3.12] gh-101100: Fix sphinx warnings in `uuid.rst` (GH-108805) (#108807)

* gh-101100: Fix sphinx warnings in `uuid.rst` (GH-108805)

* gh-101100: Fix sphinx warnings in `uuid.rst`

* Use anchors
(cherry picked from commit 21da4980f5916e8fd648f04367a9e60d141af366)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* Fix typo

* another typo

---------

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years ago[3.12] gh-106392: Fix inconsistency in deprecation warnings (GH-106436) (#108792)
Miss Islington (bot) [Sat, 2 Sep 2023 21:44:28 +0000 (14:44 -0700)] 
[3.12] gh-106392: Fix inconsistency in deprecation warnings (GH-106436) (#108792)

gh-106392: Fix inconsistency in deprecation warnings (GH-106436)

They used "datetime" to refer to both the object and the module.
(cherry picked from commit d5c5d4bfd3260219397326795d3b2ff62a9ab8cb)

Co-authored-by: William Andrea <william.j.andrea@gmail.com>
2 years ago[3.12] gh-105563: reference DateType in datetime's documentation (GH-105946) (#108789)
Miss Islington (bot) [Sat, 2 Sep 2023 21:44:06 +0000 (14:44 -0700)] 
[3.12] gh-105563: reference DateType in datetime's documentation (GH-105946) (#108789)

gh-105563: reference DateType in datetime's documentation (GH-105946)
(cherry picked from commit 8f9ea43ee805f98391f857397daac9df7ffa71cd)

Co-authored-by: TATHAGATA ROY <royzen9495@gmail.com>
2 years ago[3.12] Improve some C API documentation (GH-108768) (#108785)
Serhiy Storchaka [Sat, 2 Sep 2023 21:43:41 +0000 (00:43 +0300)] 
[3.12] Improve some C API documentation (GH-108768) (#108785)

* Express functions which take argument as a C string in terms of
  functions which take Python object.
* Use "note" directive for PyMapping_HasKey() and
  PyMapping_HasKeyString() notes..
(cherry picked from commit 6f97eeec222f81bd7ae836c149872a40b079e2a6)

2 years ago[3.12] Add Modules/_testcapi/util.h header (GH-108774) (#108780)
Miss Islington (bot) [Sat, 2 Sep 2023 21:43:14 +0000 (14:43 -0700)] 
[3.12] Add Modules/_testcapi/util.h header (GH-108774) (#108780)

Add Modules/_testcapi/util.h header (GH-108774)

It contains common macros used in C API tests.
(cherry picked from commit 0e01fac315dfa705ac8a6954485546f28cf4c87d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-101100: Fix sphinx warnings in `tutorial/appendix.rst` (GH-108750) (#108759)
Hugo van Kemenade [Sat, 2 Sep 2023 21:42:40 +0000 (15:42 -0600)] 
[3.12] gh-101100: Fix sphinx warnings in `tutorial/appendix.rst` (GH-108750) (#108759)

(cherry picked from commit 3047f09490ae63f25d57efe1d14a9a65d9b5f6db)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] Make test_fcntl quiet (GH-108758) (#108760)
Miss Islington (bot) [Fri, 1 Sep 2023 13:36:52 +0000 (06:36 -0700)] 
[3.12] Make test_fcntl quiet (GH-108758) (#108760)

Make test_fcntl quiet (GH-108758)

Running test_fcntl logs two "struct.pack: ..." lines because
multiprocessing imports test_fcntl twice with
test.support.verbose=1. Move get_lockdata() inside TestFcntl test
case and only call it where it's needed, to stop logging these lines.
(cherry picked from commit 23f54c120067c96973619b9501fe4dff1b055188)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-101100: Fix sphinx warnings in `tutorial/classes.rst` (GH-108746) (#108756)
Miss Islington (bot) [Fri, 1 Sep 2023 13:33:36 +0000 (06:33 -0700)] 
[3.12] gh-101100: Fix sphinx warnings in `tutorial/classes.rst` (GH-108746) (#108756)

gh-101100: Fix sphinx warnings in `tutorial/classes.rst` (GH-108746)
(cherry picked from commit e775601ef1ada83a80e1539d0bcd5509deadee14)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-107805: Fix signatures of module-level generated functions in `turtle`...
Miss Islington (bot) [Fri, 1 Sep 2023 13:32:35 +0000 (06:32 -0700)] 
[3.12] gh-107805: Fix signatures of module-level generated functions in `turtle` (GH-107807) (#108749)

gh-107805: Fix signatures of module-level generated functions in `turtle` (GH-107807)
(cherry picked from commit 044b8b3b6a65e6651b161e3badfa5d57c666db19)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years ago[3.12] `ast` docs: Fix incorrect link on `keyword` (GH-108728) (#108737)
Miss Islington (bot) [Fri, 1 Sep 2023 13:32:13 +0000 (06:32 -0700)] 
[3.12] `ast` docs: Fix incorrect link on `keyword` (GH-108728) (#108737)

`ast` docs: Fix incorrect link on `keyword` (GH-108728)

In two places, Sphinx was erroneously adding links to the `keyword` module instead of the `ast.keyword` class
(cherry picked from commit c1e2f3b2f70b8a72ea7e1bf792addf62a94ae65d)

Co-authored-by: Alex Povel <git@alexpovel.de>
2 years ago[3.12] gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__...
Miss Islington (bot) [Thu, 31 Aug 2023 22:04:55 +0000 (15:04 -0700)] 
[3.12] gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__ (GH-108704) (#108733)

gh-108682: [Enum] raise TypeError if super().__new__ called in custom __new__ (GH-108704)

When overriding the `__new__` method of an enum, the underlying data type should be created directly; i.e. .

    member = object.__new__(cls)
    member = int.__new__(cls, value)
    member = str.__new__(cls, value)

Calling `super().__new__()` finds the lookup version of `Enum.__new__`, and will now raise an exception when detected.
(cherry picked from commit d48760b2f1e28dd3c1a35721939f400a8ab619b8)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2 years ago[3.12] gh-97850: Note in py312 whatsnew that `importlib.util.set_loader` and `importl...
Miss Islington (bot) [Thu, 31 Aug 2023 22:03:02 +0000 (15:03 -0700)] 
[3.12] gh-97850: Note in py312 whatsnew that `importlib.util.set_loader` and `importlib.util.module_for_loader` have been removed (GH-108719) (#108723)

gh-97850: Note in py312 whatsnew that `importlib.util.set_loader` and `importlib.util.module_for_loader` have been removed (GH-108719)

Note in py312 whatsnew that `importlib.util.set_loader` and `importlib.util.module_for_loader` have been removed
(cherry picked from commit 013a99a47b3299f48cf7f95aa451a116441b029c)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years ago[3.12] gh-101100: Fix sphinx warnings in `threading.rst` (GH-108684) (#108707)
Miss Islington (bot) [Thu, 31 Aug 2023 13:32:39 +0000 (06:32 -0700)] 
[3.12] gh-101100: Fix sphinx warnings in `threading.rst` (GH-108684) (#108707)

gh-101100: Fix sphinx warnings in `threading.rst` (GH-108684)
(cherry picked from commit 991e4e76b54b69f227242e73c2ec9d62f903da53)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] gh-108654: restore comprehension locals before handling exception (GH-108659...
Miss Islington (bot) [Thu, 31 Aug 2023 13:32:17 +0000 (06:32 -0700)] 
[3.12] gh-108654: restore comprehension locals before handling exception (GH-108659) (#108700)

gh-108654: restore comprehension locals before handling exception (GH-108659)
(cherry picked from commit d52c4482a82f3f98f1a78efa948144a1fe3c52b2)

Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2 years ago[3.12] gh-108520: Fix bad fork detection in nested multiprocessing use case (GH-10856...
Miss Islington (bot) [Wed, 30 Aug 2023 21:18:49 +0000 (14:18 -0700)] 
[3.12] gh-108520: Fix bad fork detection in nested multiprocessing use case (GH-108568) (#108691)

gh-108520: Fix bad fork detection in nested multiprocessing use case (GH-108568)

gh-107275 introduced a regression where a SemLock would fail being passed along nested child processes, as the `is_fork_ctx` attribute would be left missing after the first deserialization.

---------

(cherry picked from commit add8d45cbe46581b9748909fbbf60fdc8ee8f71e)

Co-authored-by: albanD <desmaison.alban@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2 years ago[3.12] gh-101100: Fix Sphinx warnings in the Logging Cookbook (GH-108678) (#108680)
Miss Islington (bot) [Wed, 30 Aug 2023 13:21:58 +0000 (06:21 -0700)] 
[3.12] gh-101100: Fix Sphinx warnings in the Logging Cookbook (GH-108678) (#108680)

gh-101100: Fix Sphinx warnings in the Logging Cookbook (GH-108678)
(cherry picked from commit c7cef546319c51defa01236469b636b6978b99ab)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] Fix typo in multiprocessing docs (GH-108666) (#108677)
Miss Islington (bot) [Wed, 30 Aug 2023 13:21:32 +0000 (06:21 -0700)] 
[3.12] Fix typo in multiprocessing docs (GH-108666) (#108677)

Fix typo in multiprocessing docs (GH-108666)
(cherry picked from commit 38ab0dba801884b0963ef0daa95e94e120a2b524)

Co-authored-by: kato8966 <66937409+kato8966@users.noreply.github.com>
2 years ago[3.12] gh-108669: unittest: Fix documentation for TestResult.collectedDurations ...
Miss Islington (bot) [Wed, 30 Aug 2023 13:21:05 +0000 (06:21 -0700)] 
[3.12] gh-108669: unittest: Fix documentation for TestResult.collectedDurations (GH-108670) (#108672)

gh-108669: unittest: Fix documentation for TestResult.collectedDurations (GH-108670)
(cherry picked from commit 6c484c39beeb66d40ef0a73cc4f1e900ea498cfa)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2 years ago[3.12] Mention Ellipsis pickling in the docs (GH-103660) (#108661)
Miss Islington (bot) [Wed, 30 Aug 2023 13:20:45 +0000 (06:20 -0700)] 
[3.12] Mention Ellipsis pickling in the docs (GH-103660) (#108661)

Mention Ellipsis pickling in the docs (GH-103660)
(cherry picked from commit 14ec0bb7c363def917f768b76f334146a3cddd84)

Co-authored-by: sterliakov <50529348+sterliakov@users.noreply.github.com>
2 years ago[3.12] gh-107801: Improve the accuracy of io.IOBase.seek docs (#108268) (#108655)
Erlend E. Aasland [Tue, 29 Aug 2023 20:19:08 +0000 (22:19 +0200)] 
[3.12] gh-107801: Improve the accuracy of io.IOBase.seek docs (#108268) (#108655)

(cherry picked from commit 8178a88bd81edae87d6974483e4de9b32e808797)

- Add param docstrings
- Link to os.SEEK_* constants
- Mention the return value in the initial paragraph

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years ago[3.12] gh-108617: Extend interactive session tests for sqlite3 (GH-108556) (#108626)
Miss Islington (bot) [Tue, 29 Aug 2023 18:30:23 +0000 (11:30 -0700)] 
[3.12] gh-108617: Extend interactive session tests for sqlite3 (GH-108556) (#108626)

gh-108617: Extend interactive session tests for sqlite3 (GH-108556)
(cherry picked from commit ecb2bf02a4a564b638f756ce6e644ec17b6edf16)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-108558: Improve sqlite3 row factory tests (GH-108578) (#108615)
Miss Islington (bot) [Tue, 29 Aug 2023 18:29:52 +0000 (11:29 -0700)] 
[3.12] gh-108558: Improve sqlite3 row factory tests (GH-108578) (#108615)

* gh-108558: Improve sqlite3 row factory tests (GH-108578)

Add test_sqlite_row_keys() to explicitly test sqlite3.Row.keys().

Cleanups:
- Reduce test noise by converting docstrings to regular comments
- Reduce boilerplate code by adding a setUp() method to RowFactoryTests

(cherry picked from commit 6eaddc10e972273c1aed8b88c538e65e4773496e)

Co-authored-by: Edward Schauman-Haigh <142528725+EddInSverige@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
* Fix backport

---------

Co-authored-by: Edward Schauman-Haigh <142528725+EddInSverige@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years ago[3.12] gh-108550: Fix sqlite3 CLI regression from gh-108551 (GH-108618) (#108621)
Miss Islington (bot) [Tue, 29 Aug 2023 10:54:35 +0000 (03:54 -0700)] 
[3.12] gh-108550: Fix sqlite3 CLI regression from gh-108551 (GH-108618) (#108621)

gh-108550: Fix sqlite3 CLI regression from gh-108551 (GH-108618)
(cherry picked from commit c8847841cc5629cbceead0c09dc6f537d7b92612)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years ago[3.12] GH-106176, GH-104702: Fix reference leak when importing across multiple thread...
Miss Islington (bot) [Tue, 29 Aug 2023 10:40:05 +0000 (03:40 -0700)] 
[3.12] GH-106176, GH-104702: Fix reference leak when importing across multiple threads (GH-108497) (#108612)

GH-106176, GH-104702: Fix reference leak when importing across multiple threads (GH-108497)
(cherry picked from commit 5f85b443f7119e1c68a15fc9a342655e544d2852)

Co-authored-by: Brett Cannon <brett@python.org>
2 years ago[3.12] Fix misc doc typos (GH-108592) (#108594)
Miss Islington (bot) [Tue, 29 Aug 2023 10:38:03 +0000 (03:38 -0700)] 
[3.12] Fix misc doc typos (GH-108592) (#108594)

Fix misc doc typos (GH-108592)
(cherry picked from commit 88f1c5b454c34efc167a94b5e2d67ec042834e5b)

Co-authored-by: xzmeng <aumo@foxmail.com>
2 years ago[3.12] GH-108202: Combine documentation of ``calendar`` constants (GH-108492) (#108579)
Adam Turner [Mon, 28 Aug 2023 22:26:48 +0000 (23:26 +0100)] 
[3.12] GH-108202: Combine documentation of ``calendar`` constants (GH-108492) (#108579)

[3.12] GH-108202: Combine documentation of ``calendar`` constants (GH-108492).
(cherry picked from commit 5d936b64796261373429c86cdf90b1d8d8acefba)

2 years ago[3.12] gh-108550: Speed up sqlite3 tests (GH-108551) (#108566)
Miss Islington (bot) [Mon, 28 Aug 2023 22:26:29 +0000 (15:26 -0700)] 
[3.12] gh-108550: Speed up sqlite3 tests (GH-108551) (#108566)

gh-108550: Speed up sqlite3 tests (GH-108551)

Refactor the CLI so we can easily invoke it and mock command-line
arguments. Adapt the CLI tests so we no longer have to launch a
separate process.

Disable the busy handler for all concurrency tests; we have full
control over the order of the SQLite C API calls, so we can safely
do this.

The sqlite3 test suite now completes ~8 times faster than before.

(cherry picked from commit 0e8b3fc718c8a1c4de558c553d9e05049c1dbec6)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-64662: Fix virtual table support in sqlite3.Connection.iterdump (#108340...
Erlend E. Aasland [Mon, 28 Aug 2023 22:25:35 +0000 (00:25 +0200)] 
[3.12] gh-64662: Fix virtual table support in sqlite3.Connection.iterdump (#108340) (#108563)

* [3.12] gh-64662: Add virtual table support to sqlite3.Connection.iterdump (#108340)

(cherry picked from commit d0160c7c22c8dff0a61c49b5304244df6e36465e)

Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
* The _quote_value helper is not part of 3.12; spell out the replacement

* With quotes

* Ok, let's use explicit quoting

---------

Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
2 years ago[3.12] Fix typo in typing docs: Remove redundant backtick (GH-108559) (#108560)
Miss Islington (bot) [Mon, 28 Aug 2023 22:24:41 +0000 (15:24 -0700)] 
[3.12] Fix typo in typing docs: Remove redundant backtick (GH-108559) (#108560)

Fix typo in typing docs: Remove redundant backtick (GH-108559)
(cherry picked from commit 72b615ab015ccff8a92e22c5b5f97fa8aca3ba1f)

Co-authored-by: nikkie <takuyafjp+develop@gmail.com>
2 years ago[3.12] gh-107801: Document io.TextIOWrapper.tell (#108265) (#108547)
Erlend E. Aasland [Sun, 27 Aug 2023 23:59:48 +0000 (01:59 +0200)] 
[3.12] gh-107801: Document io.TextIOWrapper.tell (#108265) (#108547)

(cherry picked from commit 38afa4af9bfc8297a5ee270c37f3f120a04297ea)

2 years ago[3.12] Docs: Resolve Sphinx warnings in dis.rst (GH-108476) (#108546)
Miss Islington (bot) [Sun, 27 Aug 2023 23:59:35 +0000 (16:59 -0700)] 
[3.12] Docs: Resolve Sphinx warnings in dis.rst (GH-108476) (#108546)

Docs: Resolve Sphinx warnings in dis.rst (GH-108476)

- Link to the code objects reference
- Suppress link to deliberately undocumented builtins.__build_class__
- Suppress links for example methods
(cherry picked from commit cb1184280b3fb369a07abb4153aa36829cf1df9b)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years ago[3.12] gh-108542: Fix incorrect module name in NEWS entry for gh-105475 (#108543...
Erlend E. Aasland [Sun, 27 Aug 2023 23:58:48 +0000 (01:58 +0200)] 
[3.12] gh-108542: Fix incorrect module name in NEWS entry for gh-105475 (#108543) (#108545)

(cherry picked from commit a429eafef2d86eafc007ac19682e7d372c32da31)

2 years ago[3.12] Fix grammatical error in stringprep documentation (GH-108414) (#108537)
Miss Islington (bot) [Sun, 27 Aug 2023 15:00:07 +0000 (08:00 -0700)] 
[3.12] Fix grammatical error in stringprep documentation (GH-108414) (#108537)

Fix grammatical error in stringprep documentation (GH-108414)

Remove the word "them", which didn't make grammatical sense.

(cherry picked from commit cd0a8aece974330ef44ffe4e0f2e8aa632e98438)

Co-authored-by: Matthew James Kraai <kraai@ftbfs.org>
Co-authored-by: KRAAI, MATTHEW [VISUS] <mkraai@its.jnj.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years ago[3.12] Clarify distinction between datetime module and class in deprecation messages...
Miss Islington (bot) [Sun, 27 Aug 2023 14:16:21 +0000 (07:16 -0700)] 
[3.12] Clarify distinction between datetime module and class in deprecation messages (GH-108073) (#108540)

Clarify distinction between datetime module and class in deprecation messages (GH-108073)
(cherry picked from commit 09343dba44cdb5c279ec51df34552ef451434958)

Co-authored-by: Clément Robert <cr52@protonmail.com>
2 years ago[3.12] gh-105052:update timeit function's description (GH-105060) (#108534)
Miss Islington (bot) [Sun, 27 Aug 2023 14:15:01 +0000 (07:15 -0700)] 
[3.12] gh-105052:update timeit function's description (GH-105060) (#108534)

gh-105052:update timeit function's description (GH-105060)

---------

(cherry picked from commit 7096a2be33619dc02c06a6dc30aac414a9eba462)

Co-authored-by: R <cherrymelon@foxmail.com>
2 years ago[3.12] gh-107453: Document errno.{ECANCELED,EOWNERDEAD,ENOTRECOVERABLE,ENOTSUP} ...
Miss Islington (bot) [Sun, 27 Aug 2023 14:13:26 +0000 (07:13 -0700)] 
[3.12] gh-107453: Document errno.{ECANCELED,EOWNERDEAD,ENOTRECOVERABLE,ENOTSUP} (GH-107486) (#108529)

gh-107453: Document errno.{ECANCELED,EOWNERDEAD,ENOTRECOVERABLE,ENOTSUP} (GH-107486)
(cherry picked from commit 1ac64237e6ce965064451ed57ae37271aeb9fbd3)

Co-authored-by: qqwqqw689 <114795525+qqwqqw689@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years ago[3.12] gh-108295: Fix crashes with TypeVar weakrefs (GH-108517) (#108527)
Miss Islington (bot) [Sun, 27 Aug 2023 14:12:57 +0000 (07:12 -0700)] 
[3.12] gh-108295: Fix crashes with TypeVar weakrefs (GH-108517) (#108527)

gh-108295: Fix crashes with TypeVar weakrefs (GH-108517)
(cherry picked from commit 482fad7f01567447b7259ebf58d62999fcdc5964)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years ago[3.12] gh-107913: Fix possible losses of OSError error codes (GH-107930) (#108523)
Miss Islington (bot) [Sat, 26 Aug 2023 23:24:40 +0000 (16:24 -0700)] 
[3.12] gh-107913: Fix possible losses of OSError error codes (GH-107930) (#108523)

gh-107913: Fix possible losses of OSError error codes (GH-107930)

Functions like PyErr_SetFromErrno() and SetFromWindowsErr() should be
called immediately after using the C API which sets errno or the Windows
error code.
(cherry picked from commit 2b15536fa94d07e9e286826c23507402313ec7f4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-108487: Change assert that should've been DEOPT_IF (#108509)
Guido van Rossum [Sat, 26 Aug 2023 23:22:40 +0000 (16:22 -0700)] 
[3.12] gh-108487: Change assert that should've been DEOPT_IF (#108509)

* Remove assert that should've been DEOPT_IF

The assert(method != NULL) in CALL_NO_KW_LIST_APPEND is wrong --
this condition should lead to a deoptimization, and indeed there
is a DEOPT_IF two lines later that will trigger if method == NULL.

This would crash in a devious repro scenario (first seen live
in boto3 tests) when compiled with assertions enabled.
In a production version there is no crash, so impact is limited.

(The crash also appears in main; I will prepare a separate PR.)

* Add back a different assert(self != NULL)

* 📜🤖 Added by blurb_it.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 years ago[3.12] gh-102211: Document `re.{Pattern,Match}`’s existence (GH-102212) (#108490)
Miss Islington (bot) [Sat, 26 Aug 2023 23:21:24 +0000 (16:21 -0700)] 
[3.12] gh-102211: Document `re.{Pattern,Match}`’s existence (GH-102212) (#108490)

gh-102211: Document `re.{Pattern,Match}`’s existence (GH-102212)
(cherry picked from commit 6895ddf6cb2bada7e392eb971c88ded03d8fc79e)

Co-authored-by: Philipp A <flying-sheep@web.de>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years ago[3.12] gh-108388: Convert test_concurrent_futures to package (#108401) (#108443)
Victor Stinner [Sat, 26 Aug 2023 23:20:33 +0000 (01:20 +0200)] 
[3.12] gh-108388: Convert test_concurrent_futures to package (#108401) (#108443)

gh-108388: Convert test_concurrent_futures to package (#108401)

Convert test_concurrent_futures to a package of sub-tests.

(cherry picked from commit aa6f787faa4bc45006da4dc2f942fb9b82c98836)

2 years ago[3.12] Docs: Datamodel: Merge "Notes on using __slots__" with the parent section...
Miss Islington (bot) [Fri, 25 Aug 2023 16:23:11 +0000 (09:23 -0700)] 
[3.12] Docs: Datamodel: Merge "Notes on using __slots__" with the parent section (GH-108400) (#108474)

Docs: Datamodel: Merge "Notes on using __slots__" with the parent section (GH-108400)
(cherry picked from commit 7f5b1a06612bf1454232ac634ad4d2c845f77b37)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years ago[3.12] Datamodel: Add headings to the standard type hierarchy (GH-108146) (#108477)
Miss Islington (bot) [Fri, 25 Aug 2023 16:22:45 +0000 (09:22 -0700)] 
[3.12] Datamodel: Add headings to the standard type hierarchy (GH-108146) (#108477)

Datamodel: Add headings to the standard type hierarchy (GH-108146)

Dedent content according to the new layout.
(cherry picked from commit 2b7bff0655a4caf51cd1a9e5bf85b3b96dd031c9)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years ago[3.12] gh-108418: Speed up bigmem compression tests in dry mode (GH-108419) (#108473)
Miss Islington (bot) [Fri, 25 Aug 2023 16:22:06 +0000 (09:22 -0700)] 
[3.12] gh-108418: Speed up bigmem compression tests in dry mode (GH-108419) (#108473)

gh-108418: Speed up bigmem compression tests in dry mode (GH-108419)

Only generate and compress small amount of random data in dry run.
(cherry picked from commit 4ae3edf3008b70e20663143553a736d80ff3a501)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] GH-108202: Document ``calendar`` exceptions (GH-108398) (#108467)
Miss Islington (bot) [Fri, 25 Aug 2023 16:20:38 +0000 (09:20 -0700)] 
[3.12] GH-108202: Document ``calendar`` exceptions (GH-108398) (#108467)

GH-108202: Document ``calendar`` exceptions (GH-108398)
(cherry picked from commit 135098743a0fae0efbcd98e35458e5bc721702e9)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years ago[3.12] gh-108314: PyDict_GetItemString() mentions UTF-8 (#108448)
Victor Stinner [Fri, 25 Aug 2023 16:19:53 +0000 (18:19 +0200)] 
[3.12] gh-108314: PyDict_GetItemString() mentions UTF-8 (#108448)

gh-108314: PyDict_GetItemString() mentions UTF-8

PyDict_GetItemString(), PyDict_SetItemString() and
PyDict_DelItemString() expects a UTF-8 encoding string for the key.

2 years ago[3.12] gh-80527: Change support.requires_legacy_unicode_capi() (GH-108438) (#108446)
Miss Islington (bot) [Fri, 25 Aug 2023 16:18:24 +0000 (09:18 -0700)] 
[3.12] gh-80527: Change support.requires_legacy_unicode_capi() (GH-108438) (#108446)

gh-80527: Change support.requires_legacy_unicode_capi() (GH-108438)

The decorator now requires to be called with parenthesis:

    @support.requires_legacy_unicode_capi()

instead of:

    @support.requires_legacy_unicode_capi

The implementation now only imports _testcapi when the decorator is
called, so "import test.support" no longer imports the _testcapi
extension.
(cherry picked from commit 995f4c48e11349fbfb9233e02b732d4534d3008e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-108388: Split test_multiprocessing_spawn (GH-108396) (#108442)
Miss Islington (bot) [Fri, 25 Aug 2023 16:15:53 +0000 (09:15 -0700)] 
[3.12] gh-108388: Split test_multiprocessing_spawn (GH-108396) (#108442)

gh-108388: Split test_multiprocessing_spawn (GH-108396)

Split test_multiprocessing_fork, test_multiprocessing_forkserver and
test_multiprocessing_spawn into test packages. Each package is made
of 4 sub-tests: processes, threads, manager and misc. It allows
running more tests in parallel and so reduce the total test duration.
(cherry picked from commit aa9a359ca2663195b0f04eef46109c28c4ff74d3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-107432 Update Porting Python 2 Code to Python 3 how-to (GH-107434) (#108409)
Miss Islington (bot) [Thu, 24 Aug 2023 10:30:57 +0000 (03:30 -0700)] 
[3.12] gh-107432 Update Porting Python 2 Code to Python 3 how-to (GH-107434) (#108409)

gh-107432 Update Porting Python 2 Code to Python 3 how-to (GH-107434)

https://docs.python.org/3/howto/pyporting.htmlGH-porting-python-2-code-to-python-3 was written for another time. In this patch:

- material that frames Python 3 as "new" is removed
- descriptions and directions have been trimmed
(cherry picked from commit 809ea7c4b6c2b818ae510f1f58e82b6b05ed4ef9)

Co-authored-by: Daniele Procida <daniele@vurt.org>
2 years ago[3.12] gh-108111: Flush gzip write buffer before seeking, fixing bad writes (GH-10834...
Miss Islington (bot) [Thu, 24 Aug 2023 10:30:16 +0000 (03:30 -0700)] 
[3.12] gh-108111: Flush gzip write buffer before seeking, fixing bad writes (GH-108341) (#108402)

gh-108111: Flush gzip write buffer before seeking, fixing bad writes (GH-108341)
(cherry picked from commit 2eb60c1934f47671e6b3c9b90b6d9f1912d829a0)

Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2 years ago[3.12] gh-108342: Make ssl TestPreHandshakeClose more reliable (GH-108370) (#108404)
Łukasz Langa [Thu, 24 Aug 2023 10:08:43 +0000 (12:08 +0200)] 
[3.12] gh-108342: Make ssl TestPreHandshakeClose more reliable (GH-108370) (#108404)

* In preauth tests of test_ssl, explicitly break reference cycles
  invoving SingleConnectionTestServerThread to make sure that the
  thread is deleted. Otherwise, the test marks the environment as
  altered because the threading module sees a "dangling thread"
  (SingleConnectionTestServerThread). This test leak was introduced
  by the test added for the fix of issue gh-108310.
* Use support.SHORT_TIMEOUT instead of hardcoded 1.0 or 2.0 seconds
  timeout.
* SingleConnectionTestServerThread.run() catchs TimeoutError
* Fix a race condition (missing synchronization) in
  test_preauth_data_to_tls_client(): the server now waits until the
  client connect() completed in call_after_accept().
* test_https_client_non_tls_response_ignored() calls server.join()
  explicitly.
* Replace "localhost" with server.listener.getsockname()[0].
(cherry picked from commit 592bacb6fc0833336c0453e818e9b95016e9fd47)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-108388: regrtest splits test_asyncio package (GH-108393) (#108397)
Miss Islington (bot) [Thu, 24 Aug 2023 08:20:40 +0000 (01:20 -0700)] 
[3.12] gh-108388: regrtest splits test_asyncio package (GH-108393) (#108397)

gh-108388: regrtest splits test_asyncio package (GH-108393)

Currently, test_asyncio package is only splitted into sub-tests when
using command "./python -m test". With this change, it's also
splitted when passing it on the command line:
"./python -m test test_asyncio".

Remove the concept of "STDTESTS". Python is now mature enough to not
have to bother with that anymore. Removing STDTESTS simplify the
code.
(cherry picked from commit 174e9da0836844a2138cc8915dd305cb2cd7a583)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-70766: Mention the object getstate caveat in 3.11 What's new. (GH-108379...
Miss Islington (bot) [Wed, 23 Aug 2023 23:44:50 +0000 (16:44 -0700)] 
[3.12] gh-70766: Mention the object getstate caveat in 3.11 What's new. (GH-108379) (#108384)

gh-70766: Mention the object getstate caveat in 3.11 What's new. (GH-108379)
(cherry picked from commit b6be18812c68fce5ab56c266dc5fc5a3cceb09c0)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2 years ago[3.12] gh-77377: Ensure multiprocessing SemLock is valid for spawn-based Process...
Miss Islington (bot) [Wed, 23 Aug 2023 23:44:07 +0000 (16:44 -0700)] 
[3.12] gh-77377: Ensure multiprocessing SemLock is valid for spawn-based Process before serializing it (GH-107275) (#108377)

gh-77377: Ensure multiprocessing SemLock is valid for spawn-based Process before serializing it (GH-107275)

Ensure multiprocessing SemLock is valid for spawn Process before serializing it.

Creating a multiprocessing SemLock with a fork context, and then trying to pass it to a spawn-created Process, would segfault if not detected early.

---------

(cherry picked from commit 1700d34d314f5304a7a75363bda295a8c15c371f)

Co-authored-by: albanD <desmaison.alban@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2 years ago[3.12] gh-108267: Dataclasses docs: Fix object.__setattr__ typo (GH-108355) (#108358)
Miss Islington (bot) [Wed, 23 Aug 2023 11:46:03 +0000 (04:46 -0700)] 
[3.12] gh-108267: Dataclasses docs: Fix object.__setattr__ typo (GH-108355) (#108358)

gh-108267: Dataclasses docs: Fix object.__setattr__ typo (GH-108355)

Fixed a sentence in dataclasses.rst

Changed "__setattr__" to "object.__setattr__" in a section that was specifically supposed to refer to the __setattr__ method of the object class. Also suppressed the link to the data model docs for __setattr__, since we're talking about a specific __setattr__ implementation, not __setattr__ methods in general.
(cherry picked from commit 79fdacc0059a3959074d2d9d054653eae1dcfe06)

Co-authored-by: FrozenBob <30644137+FrozenBob@users.noreply.github.com>
2 years ago[3.12] gh-105776: Fix test_cppext when CC contains -std=c11 option (GH-108343) (...
Miss Islington (bot) [Wed, 23 Aug 2023 11:45:37 +0000 (04:45 -0700)] 
[3.12] gh-105776: Fix test_cppext when CC contains -std=c11 option (GH-108343) (#108345)

gh-105776: Fix test_cppext when CC contains -std=c11 option (GH-108343)

Fix test_cppext when the C compiler command has the "-std=c11" option.
Remove "-std=" options from the compiler command.
(cherry picked from commit 9173b2bbe13aeccc075b571da05c653a2a91de1b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-108342: Break ref cycle in SSLSocket._create() exc (GH-108344) (#108348)
Miss Islington (bot) [Wed, 23 Aug 2023 10:09:55 +0000 (03:09 -0700)] 
[3.12] gh-108342: Break ref cycle in SSLSocket._create() exc (GH-108344) (#108348)

Explicitly break a reference cycle when SSLSocket._create() raises an
exception. Clear the variable storing the exception, since the
exception traceback contains the variables and so creates a reference
cycle.

This test leak was introduced by the test added for the fix of GH-108310.
(cherry picked from commit 64f99350351bc46e016b2286f36ba7cd669b79e3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-107136: Remove Plausible for docs metrics (GH-107856) (#108334)
Miss Islington (bot) [Wed, 23 Aug 2023 09:01:19 +0000 (02:01 -0700)] 
[3.12] gh-107136: Remove Plausible for docs metrics (GH-107856) (#108334)

(cherry picked from commit fc23f34cc9701949e6832eb32f26ea89f6622b82)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] GH-92584: Remove distutils from the newtypes tutorial includes (GH-108024...
Miss Islington (bot) [Tue, 22 Aug 2023 20:07:15 +0000 (13:07 -0700)] 
[3.12] GH-92584: Remove distutils from the newtypes tutorial includes (GH-108024) (#108333)

GH-92584: Remove distutils from the newtypes tutorial includes (GH-108024)
(cherry picked from commit e97b7bef4fbe71821d59d2f41f311e514fd29e39)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years ago[3.12] Docs: Add link to skip to datetime's format codes (GH-108027) (#108329)
Miss Islington (bot) [Tue, 22 Aug 2023 20:06:53 +0000 (13:06 -0700)] 
[3.12] Docs: Add link to skip to datetime's format codes (GH-108027) (#108329)

Docs: Add link to skip to datetime's format codes (GH-108027)
(cherry picked from commit 35cb1605d08a77f1c18bd476b26391acaaa35599)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] gh-108303: Add Lib/test/test_cppext/ sub-directory (GH-108325) (#108328)
Miss Islington (bot) [Tue, 22 Aug 2023 20:06:33 +0000 (13:06 -0700)] 
[3.12] gh-108303: Add Lib/test/test_cppext/ sub-directory (GH-108325) (#108328)

gh-108303: Add Lib/test/test_cppext/ sub-directory (GH-108325)

* Move test_cppext to its own directory
* Rename setup_testcppext.py to setup.py
* Rename _testcppext.cpp to extension.cpp
* The source (extension.cpp) is now also copied by the test.
(cherry picked from commit 21dda09600848ac280481f7c64f8d9516dc69bb2)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-106016: Add Lib/test/test_module/ directory (#108293) (#108306)
Victor Stinner [Tue, 22 Aug 2023 20:06:07 +0000 (22:06 +0200)] 
[3.12] gh-106016: Add Lib/test/test_module/ directory (#108293) (#108306)

gh-106016: Add Lib/test/test_module/ directory (#108293)

* Move Python scripts related to test_module to this new directory:
  good_getattr.py and bad_getattrX.py scripts.
* Move Lib/test/test_module.py to Lib/test/test_module/__init__.py.

(cherry picked from commit adfc118fdab66882599e01a84c22bd897055f3f1)

2 years ago[3.12] Document 3.13, 3.14 and future removals (GH-108055) (#108331)
Miss Islington (bot) [Tue, 22 Aug 2023 19:38:13 +0000 (12:38 -0700)] 
[3.12] Document 3.13, 3.14 and future removals (GH-108055) (#108331)

(cherry picked from commit 39de79b345f925ce3bbb79b33534872fe0c90877)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] gh-105857: Document that asyncio subprocess std{in,out,err} can be file handle...
Miss Islington (bot) [Tue, 22 Aug 2023 19:37:14 +0000 (12:37 -0700)] 
[3.12] gh-105857: Document that asyncio subprocess std{in,out,err} can be file handles (GH-107986) (#108332)

(cherry picked from commit 13966da71b693b1fae1a8ef66e34e2f0a90ec6c0)

Co-authored-by: Hadházy Tamás <85063808+Hels15@users.noreply.github.com>
2 years ago[3.12] gh-108310: Fix CVE-2023-40217: Check for & avoid the ssl pre-close flaw (...
Łukasz Langa [Tue, 22 Aug 2023 19:03:20 +0000 (21:03 +0200)] 
[3.12] gh-108310: Fix CVE-2023-40217: Check for & avoid the ssl pre-close flaw (#108316)

Instances of `ssl.SSLSocket` were vulnerable to a bypass of the TLS handshake
and included protections (like certificate verification) and treating sent
unencrypted data as if it were post-handshake TLS encrypted data.

The vulnerability is caused when a socket is connected, data is sent by the
malicious peer and stored in a buffer, and then the malicious peer closes the
socket within a small timing window before the other peers’ TLS handshake can
begin. After this sequence of events the closed socket will not immediately
attempt a TLS handshake due to not being connected but will also allow the
buffered data to be read as if a successful TLS handshake had occurred.

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2 years ago[3.12] gh-107700: [Enum] Document that `EnumType` was added in 3.11 (GH-108260) ...
Miss Islington (bot) [Tue, 22 Aug 2023 18:34:56 +0000 (11:34 -0700)] 
[3.12] gh-107700: [Enum] Document that `EnumType` was added in 3.11 (GH-108260) (#108301)

(cherry picked from commit e8ef0bdd8c613a722bf7965bf1da912882141a52)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] Docs: align the param spec of sqlite3.Connection methods with the implementati...
Miss Islington (bot) [Tue, 22 Aug 2023 14:17:03 +0000 (07:17 -0700)] 
[3.12] Docs: align the param spec of sqlite3.Connection methods with the implementation (GH-108285) (#108287)

Docs: align the param spec of sqlite3.Connection methods with the implementation (GH-108285)

- no parameters of create_aggregate() are positional-only
- all parameters of create_collation() are positional-only
(cherry picked from commit 893215a4e7f59eabb8ccdf188c4b9b1de5bd8966)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years ago[3.12] gh-107298: Fix numerous ref errors and typos in the C API docs (GH-108258...
Miss Islington (bot) [Tue, 22 Aug 2023 14:16:31 +0000 (07:16 -0700)] 
[3.12] gh-107298: Fix numerous ref errors and typos in the C API docs (GH-108258) (#108284)

gh-107298: Fix numerous ref errors and typos in the C API docs (GH-108258)
(cherry picked from commit d7202e4879bf4e7e00a69500ddcb3143864139b4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-106971: Docs: Add missing issue reference (GH-106992) (#108283)
Miss Islington (bot) [Tue, 22 Aug 2023 14:15:59 +0000 (07:15 -0700)] 
[3.12] gh-106971: Docs: Add missing issue reference (GH-106992) (#108283)

gh-106971: Docs: Add missing issue reference (GH-106992)
(cherry picked from commit c556f9a3c9af48c9af9e1f298be638553a6c886e)

Co-authored-by: Junya Fukuda <junya.fukuda.e@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] gh-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop...
Miss Islington (bot) [Tue, 22 Aug 2023 14:15:34 +0000 (07:15 -0700)] 
[3.12] gh-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop (GH-108242) (#108275)

gh-107901: Fix missing line number on BACKWARD_JUMP at the end of a for loop (GH-108242)
(cherry picked from commit a1cc74c4eebc55795877eb3be019a1bec34402f8)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>