]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years ago[3.12] GH-110488: Fix two small issues in `pathlib.PurePath.with_name()` (GH-110651...
Barney Gale [Wed, 11 Oct 2023 04:30:23 +0000 (05:30 +0100)] 
[3.12] GH-110488: Fix two small issues in `pathlib.PurePath.with_name()` (GH-110651) (#110678)

Ensure that `PurePath('foo/a').with_name('.')` raises `ValueError`

Ensure that `PureWindowsPath('foo/a').with_name('a:b')` does not raise
`ValueError`.

(cherry picked from commit b5f7777cb3ecae02d49e0b348968c1ff1ffe21f4)

2 years ago[3.12] gh-110662: multiprocessing test_async_timeout() increase timeout (GH-110663...
Miss Islington (bot) [Wed, 11 Oct 2023 03:06:58 +0000 (05:06 +0200)] 
[3.12] gh-110662: multiprocessing test_async_timeout() increase timeout (GH-110663) (#110674)

gh-110662: multiprocessing test_async_timeout() increase timeout (GH-110663)

Increase timeout from 1 second to 30 seconds, if not longer. The
important part is that apply_async() takes longer than TIMEOUT2.
(cherry picked from commit 790ecf6302e47b84da5d1c3b14dbdf070bce615b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-110666: Fix multiprocessing test_terminate() elapsed (GH-110667) (#110668)
Miss Islington (bot) [Wed, 11 Oct 2023 02:13:01 +0000 (04:13 +0200)] 
[3.12] gh-110666: Fix multiprocessing test_terminate() elapsed (GH-110667) (#110668)

gh-110666: Fix multiprocessing test_terminate() elapsed (GH-110667)

multiprocessing test_terminate() and test_wait_socket_slow() no
longer test the CI performance: no longer check maximum elapsed time.

Add CLOCK_RES constant: tolerate a difference of 100 ms.
(cherry picked from commit 1556f426da3f2fb5842689999933c8038b65c034)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-110656: Fix logging test_post_fork_child_no_deadlock() if ASAN (GH-110657...
Miss Islington (bot) [Wed, 11 Oct 2023 01:31:49 +0000 (03:31 +0200)] 
[3.12] gh-110656: Fix logging test_post_fork_child_no_deadlock() if ASAN (GH-110657) (#110664)

gh-110656: Fix logging test_post_fork_child_no_deadlock() if ASAN (GH-110657)

Skip test_post_fork_child_no_deadlock() if Python is built with ASAN.

Add support.HAVE_ASAN_FORK_BUG.
(cherry picked from commit f901f56313610389027cb4eae80d1d4b071aef69)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-110647: Fix signal test_stress_modifying_handlers() (GH-110650) (#110658)
Miss Islington (bot) [Wed, 11 Oct 2023 00:26:48 +0000 (02:26 +0200)] 
[3.12] gh-110647: Fix signal test_stress_modifying_handlers() (GH-110650) (#110658)

gh-110647: Fix signal test_stress_modifying_handlers() (GH-110650)

* cycle_handlers() now waits until at least one signal is received.
* num_received_signals can be equal to num_sent_signals.
(cherry picked from commit e07c37cd5212c9d13749b4d02a1d68e1efcba6cf)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489) (#109682)
Miss Islington (bot) [Tue, 10 Oct 2023 20:38:18 +0000 (22:38 +0200)] 
[3.12] gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489) (#109682)

* gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489)
(cherry picked from commit e57ecf6bbc59f999d27b125ea51b042c24a07bd9)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Python 3.12 backport: update also `test_nntplib`.

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: T. Wouters <thomas@python.org>
2 years ago[3.12] gh-110631: Set three-space indents for reST in EditorConfig (GH-110635) (...
Miss Islington (bot) [Tue, 10 Oct 2023 15:20:52 +0000 (17:20 +0200)] 
[3.12] gh-110631: Set three-space indents for reST in EditorConfig (GH-110635) (#110637)

gh-110631: Set three-space indents for reST in EditorConfig (GH-110635)

Set three-space indents in EditorConfig
(cherry picked from commit 66a9b1082049855889854bfde617059499c26dd2)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] GH-109408: Move the C file whitespace check from patchcheck to pre-commit...
Adam Turner [Tue, 10 Oct 2023 15:00:00 +0000 (16:00 +0100)] 
[3.12] GH-109408: Move the C file whitespace check from patchcheck to pre-commit (GH-109890) (#110636)

(cherry picked from commit f5edb56328b46f262b74a53343b8098a3934f761)

2 years ago[3.12] GH-109408: Move the Python file whitespace check from patchcheck to pre-commit...
Miss Islington (bot) [Tue, 10 Oct 2023 14:06:35 +0000 (16:06 +0200)] 
[3.12] GH-109408: Move the Python file whitespace check from patchcheck to pre-commit (GH-109891) (#110633)

GH-109408: Move the Python file whitespace check from patchcheck to pre-commit (GH-109891)
(cherry picked from commit 08ec4a1dbf66383303de9ce5cb55b2b437ef92c0)

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] Don't doubly-parallelise sphinx-lint (GH-110617) (#110626)
Miss Islington (bot) [Tue, 10 Oct 2023 12:58:06 +0000 (14:58 +0200)] 
[3.12] Don't doubly-parallelise sphinx-lint (GH-110617) (#110626)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years ago[3.12] gh-110388: Add tests for tty (GH-110394) (#110621)
Miss Islington (bot) [Tue, 10 Oct 2023 12:55:23 +0000 (14:55 +0200)] 
[3.12] gh-110388: Add tests for tty (GH-110394) (#110621)

cherry picked from commit 7f702b26dbbf24ab5ef2be5444ae652300733b5b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-81002: Add tests for termios (GH-110386) (GH-110619)
Miss Islington (bot) [Tue, 10 Oct 2023 12:10:55 +0000 (14:10 +0200)] 
[3.12] gh-81002: Add tests for termios (GH-110386) (GH-110619)

(cherry picked from commit 92a9e980245156bf75ede0869f8ba9512e04d2eb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-101100: Fix sphinx warnings in `library/socketserver.rst` (GH-110207) ...
Miss Islington (bot) [Tue, 10 Oct 2023 12:10:22 +0000 (14:10 +0200)] 
[3.12] gh-101100: Fix sphinx warnings in `library/socketserver.rst` (GH-110207) (GH-110623)

(cherry picked from commit 756062b296df6242ba324e4cdc8f3e38bfc83617)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-110378: Fix test_async_gen_propagates_generator_exit in test_contextlib_asy...
Miss Islington (bot) [Tue, 10 Oct 2023 11:12:30 +0000 (13:12 +0200)] 
[3.12] gh-110378: Fix test_async_gen_propagates_generator_exit in test_contextlib_async (GH-110500) (#110610)

It now fails if the original bug is not fixed, and no longer produce ResourceWarning with fixed code.
(cherry picked from commit 5aa62a8de15212577a13966710b3aede46e93824)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-110590: Fix a bug where _sre.compile would overwrite exceptions (GH-110591...
Miss Islington (bot) [Tue, 10 Oct 2023 10:55:21 +0000 (12:55 +0200)] 
[3.12] gh-110590: Fix a bug where _sre.compile would overwrite exceptions (GH-110591) (#110613)

TypeError would be overwritten by OverflowError
if 'code' param contained non-ints.
(cherry picked from commit 344d3a222a7864f8157773749bdd77d1c9dfc1e6)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-110558: Enable ruff's pyupgrade rules when running on Argument Clinic ...
Miss Islington (bot) [Tue, 10 Oct 2023 10:35:21 +0000 (12:35 +0200)] 
[3.12] gh-110558: Enable ruff's pyupgrade rules when running on Argument Clinic (GH-110603) (#110609)

gh-110558: Enable ruff's pyupgrade rules when running on Argument Clinic (GH-110603)
(cherry picked from commit fc811c8d205db9c19f42890e2c4193a0c2f87965)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years ago[3.12] gh-78469: Declare missing sethostname for Solaris 10 (GH-109447) (#110580)
Miss Islington (bot) [Tue, 10 Oct 2023 09:26:36 +0000 (11:26 +0200)] 
[3.12] gh-78469: Declare missing sethostname for Solaris 10 (GH-109447) (#110580)

Add OS version specific macro for Solaris: Py_SUNOS_VERSION.
(cherry picked from commit 3b1580af07c0ce90d1c2073ab087772283d7e3b9)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2 years ago[3.12] gh-110378: Close invalid generators in contextmanager and asynccontextmanager...
Miss Islington (bot) [Tue, 10 Oct 2023 09:12:28 +0000 (11:12 +0200)] 
[3.12] gh-110378: Close invalid generators in contextmanager and asynccontextmanager (GH-110499) (#110588)

contextmanager and asynccontextmanager context managers now close an invalid
underlying generator object that yields more then one value.
(cherry picked from commit 96fed66a65097eac2dc528ce29c9ba676bb07689)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-110558: Run ruff on Argument Clinic in CI (#110559) (#110598)
Alex Waygood [Tue, 10 Oct 2023 08:58:56 +0000 (10:58 +0200)] 
[3.12] gh-110558: Run ruff on Argument Clinic in CI (#110559) (#110598)

2 years ago[3.12] gh-109408: Add the docs whitespace check from patchcheck to pre-commit (GH...
Miss Islington (bot) [Tue, 10 Oct 2023 08:39:55 +0000 (10:39 +0200)] 
[3.12] gh-109408: Add the docs whitespace check from patchcheck to pre-commit (GH-109854) (#110594)

gh-109408: Add the docs whitespace check from patchcheck to pre-commit (GH-109854)
(cherry picked from commit 7426ed0347d66f7ef61ea7ae6c3163258b8fb128)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years ago[3.12] Add some 'meta hooks' to our pre-commit config (GH-110587) (#110599)
Miss Islington (bot) [Tue, 10 Oct 2023 08:24:10 +0000 (10:24 +0200)] 
[3.12] Add some 'meta hooks' to our pre-commit config (GH-110587) (#110599)

Add some 'meta hooks' to our pre-commit config (GH-110587)
(cherry picked from commit d5ec77fafd352b4eb290b86d70e4d0b4673459eb)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years ago[3.12] Remove unused `SPHINXLINT` var from `Doc/Makefile`. (GH-110570) (#110585)
Miss Islington (bot) [Tue, 10 Oct 2023 01:14:00 +0000 (03:14 +0200)] 
[3.12] Remove unused `SPHINXLINT` var from `Doc/Makefile`. (GH-110570) (#110585)

Remove unused `SPHINXLINT` var from `Doc/Makefile`. (GH-110570)

Remove unused `SPHINXLINT` var.
(cherry picked from commit bdbe43c7d0ad5ebda0232a4ab39689ea79a9733a)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2 years ago[3.12] gh-110519: Improve deprecation warning in the gettext module (GH-110520) ...
Miss Islington (bot) [Mon, 9 Oct 2023 14:27:01 +0000 (16:27 +0200)] 
[3.12] gh-110519: Improve deprecation warning in the gettext module (GH-110520) (GH-110563)

Deprecation warning about non-integer numbers in gettext now always refers
to the line in the user code where gettext function or method is used.
Previously, it could refer to a line in gettext code.

Also, increase test coverage for NullTranslations and domain-aware functions
like dngettext().
(cherry picked from commit 326c6c4e07137b43c49b74bd5528619360080469)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-109191: Fix build with newer editline (gh-110239) (gh-110562)
Miss Islington (bot) [Mon, 9 Oct 2023 14:01:00 +0000 (16:01 +0200)] 
[3.12] gh-109191: Fix build with newer editline (gh-110239) (gh-110562)

gh-109191: Fix build with newer editline (gh-110239)
(cherry picked from commit f4cb0d27cc08f490c42a22e646eb73cc7072d54a)

Co-authored-by: Bo Anderson <mail@boanderson.me>
2 years ago[3.12] gh-110549: Remove unused includes of <stddef.h> in _testcapi (GH-110552) ...
Serhiy Storchaka [Mon, 9 Oct 2023 11:43:35 +0000 (14:43 +0300)] 
[3.12] gh-110549: Remove unused includes of <stddef.h> in _testcapi (GH-110552) (GH-110553)

(cherry picked from commit 89df5b73d07872d554da60b455b46c98e01a022d)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-110437: Allow overriding VCRuntimeDLL with a semicolon separated list of...
Miss Islington (bot) [Mon, 9 Oct 2023 11:42:04 +0000 (13:42 +0200)] 
[3.12] gh-110437: Allow overriding VCRuntimeDLL with a semicolon separated list of DLLs to bundle (GH-110470)

gh-110437: Allow overriding VCRuntimeDLL with a semicolon separated list of DLLs to bundle (GH-110470)
(cherry picked from commit 12cc6792d0ca1d0b72712d77c6efcb0aa0c7e7ba)

Co-authored-by: Steve Dower <steve.dower@python.org>
2 years ago[3.12] gh-110525: Cover PySet_Add corner case with frozenset objects (GH-110544)...
Miss Islington (bot) [Mon, 9 Oct 2023 11:40:53 +0000 (13:40 +0200)] 
[3.12] gh-110525: Cover PySet_Add corner case with frozenset objects (GH-110544) (GH-110554)

(cherry picked from commit ea39c877c0a8e7a717f2e4bf7d92a3a8780e67c0)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-109286: Update macOS installer to use SQLite 3.43.1 (GH-110482) (#110550)
Miss Islington (bot) [Mon, 9 Oct 2023 10:43:26 +0000 (12:43 +0200)] 
[3.12] gh-109286: Update macOS installer to use SQLite 3.43.1 (GH-110482) (#110550)

(cherry picked from commit 48419a50b44a195ad7de958f479a924e7c2d3e1b)

Co-authored-by: jtranquilli <76231120+jtranquilli@users.noreply.github.com>
2 years ago[3.12] gh-110525: Add CAPI tests for set and frozenset objects (GH-110526). (GH-110547)
Nikita Sobolev [Mon, 9 Oct 2023 10:04:09 +0000 (13:04 +0300)] 
[3.12] gh-110525: Add CAPI tests for set and frozenset objects (GH-110526). (GH-110547)

(cherry picked from commit c49edd7d9c5395a6a6696a4846f56bc8b2b22792)

2 years ago[3.12] gh-110497: Add note about `OSError` being an alias to `IOError` in docs (GH...
Miss Islington (bot) [Mon, 9 Oct 2023 09:42:17 +0000 (11:42 +0200)] 
[3.12] gh-110497: Add note about `OSError` being an alias to `IOError` in docs (GH-110498) (#110546)

gh-110497: Add note about `OSError` being an alias to `IOError` in docs (GH-110498)
(cherry picked from commit 5e7edac7717bfe5f3c533d83ddd0f564db8de40b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-109151: Revert readline support in the sqlite3 CLI (#110542)
Serhiy Storchaka [Mon, 9 Oct 2023 09:13:16 +0000 (12:13 +0300)] 
[3.12] gh-109151: Revert readline support in the sqlite3 CLI (#110542)

Revert "[3.12] gh-109151: Enable readline in the sqlite3 CLI (GH-109152) (#110352)"

This reverts commit bc1fe3549b32896ef0cbae3d2220ebeaf111d9b8.

2 years ago[3.12] gh-109286: Update Windows installer to use SQLite 3.43.1 (GH-110403) (#110478)
Miss Islington (bot) [Mon, 9 Oct 2023 09:12:15 +0000 (11:12 +0200)] 
[3.12] gh-109286: Update Windows installer to use SQLite 3.43.1 (GH-110403) (#110478)

gh-109286: Update Windows installer to use SQLite 3.43.1 (GH-110403)
(cherry picked from commit 201dc11aeb4699de3c5ebaea9798796c30087bcc)

Co-authored-by: jtranquilli <76231120+jtranquilli@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years ago[3.12] gh-110514: Add PY_THROW to `sys.setprofile` events (GH-110524) (#110541)
Miss Islington (bot) [Mon, 9 Oct 2023 09:11:51 +0000 (11:11 +0200)] 
[3.12] gh-110514: Add PY_THROW to `sys.setprofile` events (GH-110524) (#110541)

gh-110514: Add PY_THROW to `sys.setprofile` events (GH-110524)
(cherry picked from commit dd4bb0529e44ac6f75a9ebbfcbf5d73dc251b7a7)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2 years ago[3.12] gh-110534 fix a URL redirect to wikipedia article on Fibonacci numbers (GH...
Miss Islington (bot) [Mon, 9 Oct 2023 04:52:36 +0000 (21:52 -0700)] 
[3.12] gh-110534 fix a URL redirect to wikipedia article on Fibonacci numbers (GH-110535) (#110536)

gh-110534 fix a URL redirect to wikipedia article on Fibonacci numbers (GH-110535)
(cherry picked from commit 892ee72b3622de30acd12576b59259fc69e2e40a)

Co-authored-by: partev <petrosyan@gmail.com>
2 years ago[3.12] gh-110237: Check `PyList_Append` for errors in `_PyEval_MatchClass` (GH-110238...
Miss Islington (bot) [Sun, 8 Oct 2023 00:40:38 +0000 (17:40 -0700)] 
[3.12] gh-110237: Check `PyList_Append` for errors in `_PyEval_MatchClass` (GH-110238) (#110511)

gh-110237: Check `PyList_Append` for errors in `_PyEval_MatchClass` (GH-110238)
(cherry picked from commit dd9d781da30aa3740e54c063a40413c542d78c25)

Co-authored-by: denballakh <47365157+denballakh@users.noreply.github.com>
2 years ago[3.12] Update floatingpoint.rst (GH-110509) (#110513)
Miss Islington (bot) [Sun, 8 Oct 2023 00:18:39 +0000 (17:18 -0700)] 
[3.12] Update floatingpoint.rst (GH-110509) (#110513)

Update floatingpoint.rst (GH-110509)

This commit removes a ':'. I believe the extra colon causes a display error.

What I believe to be an error:
Above this expression
`round(math.pi, ndigits=2) == round(22 / 7, ndigits=2)`
the page displays `.. doctest::`.

What I observed:
After I remove the extra colon, the page does not display `.. doctest::`
(cherry picked from commit 8e56d551ceef37a307280bcc5303bf69ccc9f9c1)

Co-authored-by: zipperer <47086307+zipperer@users.noreply.github.com>
2 years ago[3.12] gh-109848: Make test_rot13_func in test_codecs independent (GH-109850) (GH...
Miss Islington (bot) [Sat, 7 Oct 2023 13:39:19 +0000 (06:39 -0700)] 
[3.12] gh-109848: Make test_rot13_func in test_codecs independent (GH-109850) (GH-110504)

(cherry picked from commit b987fdb19b981ef6e7f71b41790b5ed4e2064646)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-109864: Make test_gettext tests order independent (GH-109866) (GH-110502)
Miss Islington (bot) [Sat, 7 Oct 2023 13:28:59 +0000 (06:28 -0700)] 
[3.12] gh-109864: Make test_gettext tests order independent (GH-109866) (GH-110502)

(cherry picked from commit 1aad4fc5dba993899621de86ae5955883448d6f6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] GH-110455: Guard `assert(tstate->thread_id > 0)` with `GH-ifndef HAVE_PTHREAD_...
Miss Islington (bot) [Fri, 6 Oct 2023 23:48:48 +0000 (16:48 -0700)] 
[3.12] GH-110455: Guard `assert(tstate->thread_id > 0)` with `GH-ifndef HAVE_PTHREAD_STUBS` (GH-110487) (GH-110491)

GH-110455: Guard `assert(tstate->thread_id > 0)` with `GH-ifndef HAVE_PTHREAD_STUBS` (GH-110487)
(cherry picked from commit 5fd8821cf8eb1fe2e8575f8c7cc747cf78855a88)

Co-authored-by: Brett Cannon <brett@python.org>
2 years ago[3.12] Fix typo in Doc/library/textwrap.rst (GH-110328) (#110473)
Miss Islington (bot) [Fri, 6 Oct 2023 14:33:16 +0000 (07:33 -0700)] 
[3.12] Fix typo in Doc/library/textwrap.rst (GH-110328) (#110473)

Co-authored-by: InSync <122007197+InSyncWithFoo@users.noreply.github.com>
2 years ago[3.12] gh-110184: Fix subprocess test_pipesize_default() (GH-110465) (#110471)
Miss Islington (bot) [Fri, 6 Oct 2023 14:09:29 +0000 (07:09 -0700)] 
[3.12] gh-110184: Fix subprocess test_pipesize_default() (GH-110465) (#110471)

gh-110184: Fix subprocess test_pipesize_default() (GH-110465)

For proc.stdin, get the size of the read end of the test pipe.

Use subprocess context manager ("with proc:").
(cherry picked from commit d023d4166b255023dac448305270350030101481)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-103053: Fix test_tools.test_freeze on FreeBSD (GH-110451) (#110456)
Miss Islington (bot) [Fri, 6 Oct 2023 01:31:30 +0000 (18:31 -0700)] 
[3.12] gh-103053: Fix test_tools.test_freeze on FreeBSD (GH-110451) (#110456)

gh-103053: Fix test_tools.test_freeze on FreeBSD (GH-110451)

Fix test_tools.test_freeze on FreeBSD: run "make distclean" instead
of "make clean" in the copied source directory to remove also the
"python" program.

Other test_freeze changes:

* Log executed commands and directories, and the current directory.
* No longer uses make -C option to change the directory, instead use
  subprocess cwd parameter.
(cherry picked from commit a4baa9e8ac62cac3ea6363b15ea585b1998ea1f9)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] Add support.MS_WINDOWS constant (#110446) (#110452)
Victor Stinner [Fri, 6 Oct 2023 01:26:14 +0000 (03:26 +0200)] 
[3.12] Add support.MS_WINDOWS constant (#110446) (#110452)

Add support.MS_WINDOWS constant (#110446)

(cherry picked from commit e0c44377935de3491b2cbe1e5f87f8b336fdc922)

2 years ago[3.12] gh-103053: Fix make check-clean-src: check "python" program (GH-110449) (...
Miss Islington (bot) [Fri, 6 Oct 2023 01:23:15 +0000 (18:23 -0700)] 
[3.12] gh-103053: Fix make check-clean-src: check "python" program (GH-110449) (#110453)

gh-103053: Fix make check-clean-src: check "python" program (GH-110449)

"make check-clean-src" now also checks if the "python" program is
found in the source directory: fail with an error if it does exist.
(cherry picked from commit a155f9f3427578ca5706d27e20bd0576f0395073)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109888: Fix test_os _kill_with_event() on Windows (GH-110421) (#110442)
Miss Islington (bot) [Thu, 5 Oct 2023 22:20:55 +0000 (15:20 -0700)] 
[3.12] gh-109888: Fix test_os _kill_with_event() on Windows (GH-110421) (#110442)

gh-109888: Fix test_os _kill_with_event() on Windows (GH-110421)

Replace os.kill() with proc.kill() which catchs PermissionError.

Rewrite _kill_with_event():

* Use subprocess context manager ("with proc:").
* Use sleeping_retry() to wait until the child process is ready.
* Replace SIGINT with proc.kill() on error.
* Replace 10 seconds with SHORT_TIMEOUT to wait until the process is
  ready.
* Replace 0.5 seconds with SHORT_TIMEOUT to wait for the process
  exit.
(cherry picked from commit aaf297c048694cd9652790f8b74e69f7ddadfbde)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-110393: Remove watchdog with hardcoded timeout (GH-110400) (#110445)
Miss Islington (bot) [Thu, 5 Oct 2023 22:17:20 +0000 (15:17 -0700)] 
[3.12] gh-110393: Remove watchdog with hardcoded timeout (GH-110400) (#110445)

gh-110393: Remove watchdog with hardcoded timeout (GH-110400)

test_builtin and test_socketserver no longer use signal.alarm() to
implement a watchdog with a hardcoded timeout (2 and 60 seconds).
Python test runner regrtest has two watchdogs: faulthandler and
timeout on running worker processes. Tests using short hardcoded
timeout can fail on slowest buildbots just because the timeout is too
short.
(cherry picked from commit 1328fa31fe9c72748fc6fd11d017c82aafd48a49)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-110429: Fix race condition in "make regen-all" (GH-110433) (#110438)
Miss Islington (bot) [Thu, 5 Oct 2023 20:54:47 +0000 (13:54 -0700)] 
[3.12] gh-110429: Fix race condition in "make regen-all" (GH-110433) (#110438)

gh-110429: Fix race condition in "make regen-all" (GH-110433)

"make regen-pegen" now creates a temporary file called "parser.c.new"
instead of "parser.new.c". Previously, if "make clinic" was run in
parallel with "make regen-all", clinic may try but fail to open
"parser.new.c" if the temporay file was removed in the meanwhile.
(cherry picked from commit fb6c4ed2bbb2a867d5f0b9a94656e4714be5d9c2)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (#110413) (#110427)
Victor Stinner [Thu, 5 Oct 2023 20:37:20 +0000 (22:37 +0200)] 
[3.12] gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (#110413) (#110427)

gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (#110413)

Increase support.LOOPBACK_TIMEOUT from 5 to 10 seconds. Also increase
the timeout depending on the --timeout option. For example, for a
test timeout of 40 minutes (ARM Raspbian 3.x), use LOOPBACK_TIMEOUT
of 20 seconds instead of 5 seconds before.

(cherry picked from commit 0db2f1475e6539e1954e1f8bd53e005c3ecd6a26)

2 years ago[3.12] gh-110383: Swap 'the all' -> 'all the' in socket docs (GH-110434) (#110435)
Miss Islington (bot) [Thu, 5 Oct 2023 20:14:22 +0000 (13:14 -0700)] 
[3.12] gh-110383: Swap 'the all' -> 'all the' in socket docs (GH-110434) (#110435)

Co-authored-by: Bradley Reynolds <bradley.reynolds@darbia.dev>
2 years ago[3.12] gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428) (#110430)
Miss Islington (bot) [Thu, 5 Oct 2023 20:03:53 +0000 (13:03 -0700)] 
[3.12] gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428) (#110430)

gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428)

Don't measure the CI performance: don't fail if cond.wait_for() takes
longer than 1 second on a slow CI.
(cherry picked from commit 5eae8dc2cb832af6ae1ee340fb0194107fe3bd6e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-110167: Fix test_socket deadlock in doCleanups() (GH-110416) (#110423)
Miss Islington (bot) [Thu, 5 Oct 2023 19:24:26 +0000 (12:24 -0700)] 
[3.12] gh-110167: Fix test_socket deadlock in doCleanups() (GH-110416) (#110423)

gh-110167: Fix test_socket deadlock in doCleanups() (GH-110416)

Fix a deadlock in test_socket when server fails with a timeout but
the client is still running in its thread. Don't hold a lock to call
cleanup functions in doCleanups(). One of the cleanup function waits
until the client completes, whereas the client could deadlock if it
called addCleanup() in such situation.

doCleanups() is called when the server completed, but the client can
still be running in its thread especially if the server failed with a
timeout. Don't put a lock on doCleanups() to prevent deadlock between
addCleanup() called in the client and doCleanups() waiting for
self.done.wait of ThreadableTest._setUp().
(cherry picked from commit 318f5df27109ff8d2519edefa771920a0ec62b92)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-110383 TimeIt Docs Spelling Fix (GH-110407) (#110409)
Miss Islington (bot) [Thu, 5 Oct 2023 17:42:52 +0000 (10:42 -0700)] 
[3.12] gh-110383 TimeIt Docs Spelling Fix (GH-110407) (#110409)

gh-110383 TimeIt Docs Spelling Fix (GH-110407)

Make 0.2 second plural
(cherry picked from commit a973bf0f97e55ace9eab100f9eb95d7eedcb28ac)

Co-authored-by: Towster15 <105541074+Towster15@users.noreply.github.com>
2 years ago[3.12] Fix env var typo in perf profiling docs (GH-110404) (#110414)
Miss Islington (bot) [Thu, 5 Oct 2023 17:40:19 +0000 (10:40 -0700)] 
[3.12] Fix env var typo in perf profiling docs (GH-110404) (#110414)

Fix env var typo in perf profiling docs (GH-110404)

Fix typo in docs
(cherry picked from commit a13620685f68957c965fca89343a0e91f95f1bab)

Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2 years ago[3.12] gh-110391: socket NetworkConnectionAttributesTest always declare cli (GH-11040...
Miss Islington (bot) [Thu, 5 Oct 2023 17:01:59 +0000 (10:01 -0700)] 
[3.12] gh-110391: socket NetworkConnectionAttributesTest always declare cli (GH-110401) (#110405)

gh-110391: socket NetworkConnectionAttributesTest always declare cli (GH-110401)

NetworkConnectionAttributesTest of test_socket now always declare the
'cli' attribute, so clientTearDown() cannot fail with AttributeError.
(cherry picked from commit e37d4557c3de0476e76ca4b8a1cc8d2566b86c79)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-110259: Fix f-strings with multiline expressions and format specs (GH-11027...
Miss Islington (bot) [Thu, 5 Oct 2023 14:07:25 +0000 (07:07 -0700)] 
[3.12] gh-110259: Fix f-strings with multiline expressions and format specs (GH-110271) (#110396)

gh-110259: Fix f-strings with multiline expressions and format specs (GH-110271)
(cherry picked from commit cc389ef627b2a486ab89d9a11245bef48224efb1)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2 years ago[3.12] gh-110365: Fix error overwrite in `termios.tcsetattr` (GH-110366) (#110389)
Miss Islington (bot) [Thu, 5 Oct 2023 12:21:03 +0000 (05:21 -0700)] 
[3.12] gh-110365: Fix error overwrite in `termios.tcsetattr` (GH-110366) (#110389)

(cherry picked from commit 2bbbab212fb10b3aeaded188fb5d6c001fb4bf74)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years ago[3.12] Remove duplicate word. (GH-110376) (GH-110377)
Miss Islington (bot) [Thu, 5 Oct 2023 04:26:44 +0000 (21:26 -0700)] 
[3.12] Remove duplicate word. (GH-110376) (GH-110377)

Remove duplicate word. (GH-110376)
(cherry picked from commit 313aa861ce23e83ca64284d97c1dac234c9def7c)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2 years ago[3.12] Add back bltin-boolean-values ref tag (GH-110371) (#110372)
Miss Islington (bot) [Wed, 4 Oct 2023 20:05:21 +0000 (13:05 -0700)] 
[3.12] Add back bltin-boolean-values ref tag (GH-110371) (#110372)

Add back bltin-boolean-values ref tag (GH-110371)

To avoid breaking downstream intersphinx via numpydoc
(cherry picked from commit f7860295b16a402621e209871c8eaeeea16f464e)

Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>
2 years ago[3.12] Lint: Remove files that no longer fail to parse (GH-110356) (#110360)
Hugo van Kemenade [Wed, 4 Oct 2023 14:31:03 +0000 (08:31 -0600)] 
[3.12] Lint: Remove files that no longer fail to parse (GH-110356) (#110360)

Remove files that no longer fail to parse

2 years ago[3.12] gh-109151: Enable readline in the sqlite3 CLI (GH-109152) (#110352)
Miss Islington (bot) [Wed, 4 Oct 2023 13:48:31 +0000 (06:48 -0700)] 
[3.12] gh-109151: Enable readline in the sqlite3 CLI (GH-109152) (#110352)

gh-109151: Enable readline in the sqlite3 CLI (GH-109152)
(cherry picked from commit 254e30c487908a52a7545cea205aeaef5fbfeea4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-85984: Document change in return type of tty functions (GH-110028) (#110324)
Miss Islington (bot) [Wed, 4 Oct 2023 11:57:14 +0000 (04:57 -0700)] 
[3.12] gh-85984: Document change in return type of tty functions (GH-110028) (#110324)

gh-85984: Document change in return type of tty functions (GH-110028)
(cherry picked from commit f02f26e29366513b097578fbc6b25e02d0eba7c0)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years ago[3.12] Enhance TypedDict docs around required/optional keys (GH-109547) (#109982)
Miss Islington (bot) [Wed, 4 Oct 2023 11:56:58 +0000 (04:56 -0700)] 
[3.12] Enhance TypedDict docs around required/optional keys (GH-109547) (#109982)

Enhance TypedDict docs around required/optional keys (GH-109547)

As discussed in comments to GH-109544, the semantics of this attribute
are somewhat confusing. Add a note explaining its limitations and
steering users towards __required_keys__ and __optional_keys__ instead.
(cherry picked from commit f49958c886a2f2608f1008186d588efc2a98b445)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years ago[3.12] gh-109972: Enhance test_gdb (#110026) (#110351)
Victor Stinner [Wed, 4 Oct 2023 11:34:28 +0000 (13:34 +0200)] 
[3.12] gh-109972: Enhance test_gdb (#110026) (#110351)

* gh-109972: Enhance test_gdb (#110026)

* Split test_pycfunction.py: add test_cfunction_full.py.
  Split the function into the following 6 functions. In verbose
  mode, these "pycfunction" tests now log each tested call.

  * test_pycfunction_noargs()
  * test_pycfunction_o()
  * test_pycfunction_varargs()
  * test_pycfunction_varargs_keywords()
  * test_pycfunction_fastcall()
  * test_pycfunction_fastcall_keywords()

* Move get_gdb_repr() to PrettyPrintTests.
* Replace DebuggerTests.get_sample_script() with SAMPLE_SCRIPT.
* Rename checkout_hook_path to CHECKOUT_HOOK_PATH.
* Rename gdb_version to GDB_VERSION_TEXT.
* Replace (gdb_major_version, gdb_minor_version) with GDB_VERSION.
* run_gdb() uses "backslashreplace" error handler instead of "replace".
* Add check_gdb() function to util.py.
* Enhance support.check_cflags_pgo(): check also for sysconfig
  PGO_PROF_USE_FLAG (if available) in compiler flags.
* Move some SkipTest checks to test_gdb/__init__.py.
* Elaborate why gdb cannot be tested on Windows: gdb doesn't support
  PDB debug symbol files.

(cherry picked from commit 757cbd4f29c9e89b38b975e0463dc8ed331b2515)

* gh-104736: Fix test_gdb tests on ppc64le with clang (#109360)

Fix test_gdb on Python built with LLVM clang 16 on Linux ppc64le (ex:
Fedora 38). Search patterns in gdb "bt" command output to detect
when gdb fails to retrieve the traceback. For example, skip a test if
"Backtrace stopped: frame did not save the PC" is found.

(cherry picked from commit 44d9a71ea246e7c3fb478d9be62c16914be6c545)

* gh-110166: Fix gdb CFunctionFullTests on ppc64le clang build (#110331)

CFunctionFullTests now also runs "bt" command before "py-bt-full",
similar to CFunctionTests which also runs "bt" command before
"py-bt". So test_gdb can skip the test if patterns like "?? ()" are
found in the gdb output.

(cherry picked from commit 1de9406f9136e3952b849487f0151be3c669a3ea)

2 years ago[3.12] gh-109974: Fix threading lock_tests race conditions (#110057) (#110346)
Victor Stinner [Wed, 4 Oct 2023 11:26:45 +0000 (13:26 +0200)] 
[3.12] gh-109974: Fix threading lock_tests race conditions (#110057) (#110346)

* gh-109974: Fix threading lock_tests race conditions (#110057)

Fix race conditions in test_threading lock tests. Wait until a
condition is met rather than using time.sleep() with a hardcoded
number of seconds.

* Replace sleeping loops with support.sleeping_retry() which raises
  an exception on timeout.
* Add wait_threads_blocked(nthread) which computes a sleep depending
  on the number of threads. Remove _wait() function.
* test_set_and_clear(): use a way longer Event.wait() timeout.
* BarrierTests.test_repr(): wait until the 2 threads are waiting for
  the barrier. Use a way longer timeout for Barrier.wait() timeout.
* test_thread_leak() no longer needs to count
  len(threading.enumerate()): Bunch uses
  threading_helper.wait_threads_exit() internally which does it in
  wait_for_finished().
* Add BaseLockTests.wait_phase() which implements a timeout.
  test_reacquire() and test_recursion_count() use wait_phase().

(cherry picked from commit 4e356ad183eeb567783f4a87fd092573da1e9252)

* gh-109974: Fix more threading lock_tests race conditions (#110089)

* Add context manager on Bunch class.
* Bunch now catchs exceptions on executed functions and re-raise them
  at __exit__() as an ExceptionGroup.
* Rewrite BarrierProxy.test_default_timeout(). Use a single thread.
  Only check that barrier.wait() blocks for at least default timeout
  seconds.
* test_with(): inline _with() function.

(cherry picked from commit 743e3572ee940a6cf88fd518e5f4a447905ba5eb)

2 years ago[3.12] gh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (GH-11033...
Miss Islington (bot) [Wed, 4 Oct 2023 11:25:13 +0000 (04:25 -0700)] 
[3.12] gh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (GH-110334) (#110349)

gh-110332: Remove mentions of `random.WichmannHill` from `test_zlib` (GH-110334)
(cherry picked from commit e9f2352b7b7503519790ee6f51c2e298cf390e75)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-108987: Fix _thread.start_new_thread() race condition (#109135) (#110342)
Victor Stinner [Wed, 4 Oct 2023 11:20:31 +0000 (13:20 +0200)] 
[3.12] gh-108987: Fix _thread.start_new_thread() race condition (#109135) (#110342)

* gh-108987: Fix _thread.start_new_thread() race condition (#109135)

Fix _thread.start_new_thread() race condition. If a thread is created
during Python finalization, the newly spawned thread now exits
immediately instead of trying to access freed memory and lead to a
crash.

thread_run() calls PyEval_AcquireThread() which checks if the thread
must exit. The problem was that tstate was dereferenced earlier in
_PyThreadState_Bind() which leads to a crash most of the time.

Move _PyThreadState_CheckConsistency() from thread_run() to
_PyThreadState_Bind().

(cherry picked from commit 517cd82ea7d01b344804413ef05610934a43a241)

* gh-109795: `_thread.start_new_thread`: allocate thread bootstate using raw memory allocator (#109808)

(cherry picked from commit 1b8f2366b38c87b0450d9c15bdfdd4c4a2fc3a01)

---------

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
2 years ago[3.12] gh-110335: asyncio test_unix_events cleans multiprocessing (GH-110336) (#110338)
Miss Islington (bot) [Wed, 4 Oct 2023 10:33:14 +0000 (03:33 -0700)] 
[3.12] gh-110335: asyncio test_unix_events cleans multiprocessing (GH-110336) (#110338)

gh-110335: asyncio test_unix_events cleans multiprocessing (GH-110336)

test_unix_events tests using the multiprocessing module now call
multiprocessing.util._cleanup_tests().
(cherry picked from commit 1337765225d7d593169205672e004f97e15237ec)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109615: Fix support test_copy_python_src_ignore() (#109958) (#110340)
Victor Stinner [Wed, 4 Oct 2023 10:27:12 +0000 (12:27 +0200)] 
[3.12] gh-109615: Fix support test_copy_python_src_ignore() (#109958) (#110340)

* gh-109615: Fix support test_copy_python_src_ignore() (#109958)

Fix the test when run on an installed Python: use "abs_srcdir" of
sysconfig, and skip the test if the Python source code cannot be
found.

* Tools/patchcheck/patchcheck.py, Tools/freeze/test/freeze.py and
  Lib/test/libregrtest/utils.py now first try to get "abs_srcdir"
  from sysconfig, before getting "srcdir" from sysconfig.
* test.pythoninfo logs sysconfig "abs_srcdir".

(cherry picked from commit b89ed9df39851348fbb1552294644f99f6b17d2c)

* gh-109615: Fix support test_copy_python_src_ignore() on WASM (#109970)

Not only check if src_dir exists, but look also for Lib/os.py
landmark.

(cherry picked from commit cc54bcf17b5b5f7681f52baf3acef75b995fa1fd)

* gh-109615: Look for 'Modules' as landmark for test_copy_python_src_ignore (GH-110108)

(cherry picked from commit 20bc5f7c28a6f8a2e156c4a748ffabb5efc7c761)

* gh-109748: Fix again venv test_zippath_from_non_installed_posix() (#110149)

Call also copy_python_src_ignore() on listdir() names.

shutil.copytree(): replace set() with an empty tuple. An empty tuple
becomes a constant in the compiler and checking if an item is in an
empty tuple is cheap.

(cherry picked from commit 0def8c712bb6f66f1081cab71deb3681566b846d)

---------

Co-authored-by: Steve Dower <steve.dower@python.org>
2 years ago[3.12] gh-109972: Split test_gdb.py into test_gdb package (#109977) (#110339)
Victor Stinner [Wed, 4 Oct 2023 10:26:24 +0000 (12:26 +0200)] 
[3.12] gh-109972: Split test_gdb.py into test_gdb package (#109977) (#110339)

gh-109972: Split test_gdb.py into test_gdb package (#109977)

Split test_gdb.py file into a test_gdb package made of multiple
tests, so tests can now be run in parallel.

* Create Lib/test/test_gdb/ directory.
* Split test_gdb.py into multiple files in Lib/test/test_gdb/
  directory.
* Move Lib/test/gdb_sample.py to Lib/test/test_gdb/ directory.
  Update get_sample_script(): use __file__ to locate gdb_sample.py.
* Move gdb_has_frame_select() and HAS_PYUP_PYDOWN to test_misc.py.
* Explicitly skip test_gdb on Windows. Previously, test_gdb was
  skipped even if gdb was available because of
  gdb_has_frame_select().

(cherry picked from commit 8f324b7ecd2df3036fab098c4c8ac185ac07b277)

2 years ago[3.12] gh-110267: Add tests for pickling and copying PyStructSequence objects (GH...
Miss Islington (bot) [Wed, 4 Oct 2023 09:01:03 +0000 (02:01 -0700)] 
[3.12] gh-110267: Add tests for pickling and copying PyStructSequence objects (GH-110272) (GH-110285)

(cherry picked from commit 2d4865d775123e8889c7a79fc49b4bf627176c4b)

Co-authored-by: Xuehai Pan <XuehaiPan@pku.edu.cn>
2 years ago[3.12] gh-109917: Fix test instability in test_concurrent_futures (GH-110306) (#110315)
Miss Islington (bot) [Tue, 3 Oct 2023 22:28:13 +0000 (15:28 -0700)] 
[3.12] gh-109917: Fix test instability in test_concurrent_futures (GH-110306) (#110315)

gh-109917: Fix test instability in test_concurrent_futures (GH-110306)

The test had an instability issue due to the ordering of the dummy
queue operation and the real wakeup pipe operations. Both primitives
are thread safe but not done atomically as a single update and may
interleave arbitrarily. With the old order of operations this can lead
to an incorrect state where the dummy queue is full but the wakeup
pipe is empty. By swapping the order in clear() I think this can no
longer happen in any possible operation interleaving (famous last
words).
(cherry picked from commit a376a72bd92cd7c9930467dd1aba40045fb75e3b)

Co-authored-by: elfstrom <elfstrom@users.noreply.github.com>
2 years ago[3.12] Docs: Avoid the deprecated ``.. cmdoption::`` directive (GH-110292) (#110302)
Adam Turner [Tue, 3 Oct 2023 17:55:29 +0000 (18:55 +0100)] 
[3.12] Docs: Avoid the deprecated ``.. cmdoption::`` directive (GH-110292) (#110302)

[3.12] Docs: Avoid the deprecated ``.. cmdoption::`` directive (GH-110292).
(cherry picked from commit 77e9aae3837d9f0cf87461d023896f2c4aeb282f)

2 years ago[3.12] gh-109234: Hint to contextlib.closing in sqlite3 context manager docs (GH...
Miss Islington (bot) [Tue, 3 Oct 2023 16:02:44 +0000 (09:02 -0700)] 
[3.12] gh-109234: Hint to contextlib.closing in sqlite3 context manager docs (GH-109322) (#110294)

(cherry picked from commit 4227bfa8b273207a2b882f7d69c8ac49c3d2b57d)

Co-authored-by: Lincoln <71312724+Lincoln-developer@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2 years ago[3.12] Enable ruff on `Lib/test/test_typing.py` (#110179) (#110288)
Alex Waygood [Tue, 3 Oct 2023 15:13:22 +0000 (16:13 +0100)] 
[3.12] Enable ruff on `Lib/test/test_typing.py` (#110179) (#110288)

Enable ruff on `Lib/test/test_typing.py` (#110179)

2 years ago[3.12] Bump various dependencies in `Doc/requirements-oldest-sphinx.txt` (GH-110278...
Miss Islington (bot) [Tue, 3 Oct 2023 13:18:09 +0000 (06:18 -0700)] 
[3.12] Bump various dependencies in `Doc/requirements-oldest-sphinx.txt` (GH-110278) (#110280)

Bump various dependencies in `Doc/requirements-oldest-sphinx.txt` (GH-110278)

This resolves a Dependabot security alert on the repository for urllib3==2.0.4.
(cherry picked from commit f1663a492e14c80c30cb9741fdc36fa221d5e30a)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years ago[3.12] Fix typo in py312 whatsnew: add missing closing paren (GH-110255) (#110257)
Miss Islington (bot) [Tue, 3 Oct 2023 06:20:20 +0000 (23:20 -0700)] 
[3.12] Fix typo in py312 whatsnew: add missing closing paren (GH-110255) (#110257)

Fix typo in py312 whatsnew: add missing closing paren (GH-110255)
(cherry picked from commit 8c071373f12f325c54591fe990ec026184e48f8f)

Co-authored-by: Lele Gaifax <lele@metapensiero.it>
2 years ago[3.12] Remove unused Misc/requirements-test.txt (GH-110240) (#110253)
Miss Islington (bot) [Tue, 3 Oct 2023 05:36:30 +0000 (22:36 -0700)] 
[3.12] Remove unused Misc/requirements-test.txt (GH-110240) (#110253)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] gh-109653: Reduce the import time of `random` by 60% (GH-110221) (#110247)
Miss Islington (bot) [Mon, 2 Oct 2023 23:31:55 +0000 (16:31 -0700)] 
[3.12] gh-109653: Reduce the import time of `random` by 60% (GH-110221) (#110247)

gh-109653: Fix regression in the import time of `random` in Python 3.12 (GH-110221)
(cherry picked from commit 21a6263020db17020b2886f996bc23aa8cb7fbdf)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years ago[3.12] gh-110241: Add missing error check to `record_eval` in `_testinternalcapi...
Miss Islington (bot) [Mon, 2 Oct 2023 21:38:25 +0000 (14:38 -0700)] 
[3.12] gh-110241: Add missing error check to `record_eval` in `_testinternalcapi` (GH-110242) (#110244)

gh-110241: Add missing error check to `record_eval` in `_testinternalcapi` (GH-110242)
(cherry picked from commit 4596c76d1a7650fd4650c814dc1d40d664cd8fb4)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-108494: Document how to add a project in PCbuild/readme.txt (GH-110077...
Miss Islington (bot) [Mon, 2 Oct 2023 19:48:31 +0000 (12:48 -0700)] 
[3.12] gh-108494: Document how to add a project in PCbuild/readme.txt (GH-110077) (#110230)

gh-108494: Document how to add a project in PCbuild/readme.txt (GH-110077)

(cherry picked from commit 6387b5313c60c1403785b2245db33372476ac304)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-110088, gh-109878: Fix test_asyncio timeouts (#110092) (#110098)
Victor Stinner [Mon, 2 Oct 2023 19:35:29 +0000 (21:35 +0200)] 
[3.12] gh-110088, gh-109878: Fix test_asyncio timeouts (#110092) (#110098)

gh-110088, gh-109878: Fix test_asyncio timeouts (#110092)

Fix test_asyncio timeouts: don't measure the maximum duration, a test
should not measure a CI performance. Only measure the minimum
duration when a task has a timeout or delay. Add CLOCK_RES to
test_asyncio.utils.

(cherry picked from commit db0a258e796703e12befea9d6dec04e349ca2f5b)

2 years ago[3.12] gh-110031: Skip test_threading fork tests if ASAN (#110100) (#110103)
Victor Stinner [Mon, 2 Oct 2023 19:31:12 +0000 (21:31 +0200)] 
[3.12] gh-110031: Skip test_threading fork tests if ASAN (#110100) (#110103)

gh-110031: Skip test_threading fork tests if ASAN (#110100)

Skip test_threading tests using thread+fork if Python is built with
Address Sanitizer (ASAN).

(cherry picked from commit 86e76ab8af9a5018acbcdcbb6285678175b1bd8a)

2 years ago[3.12] gh-109782: Ensure `os.path.isdir` has the same signature on all platforms...
Alex Waygood [Mon, 2 Oct 2023 19:25:06 +0000 (20:25 +0100)] 
[3.12] gh-109782: Ensure `os.path.isdir` has the same signature on all platforms (GH-109790) (#110233)

gh-109782: Ensure `os.path.isdir` has the same signature on all platforms (GH-109790)

Co-authored-by: Amin Alaee <mohammadamin.alaee@gmail.com>
2 years ago[3.12] Sync factor() recipe with main branch (gh-110231)
Raymond Hettinger [Mon, 2 Oct 2023 19:19:46 +0000 (14:19 -0500)] 
[3.12] Sync factor() recipe with main branch (gh-110231)

2 years ago[3.12] Fix typos in docs and comments (#109619) (#109621)
Alex Waygood [Mon, 2 Oct 2023 17:34:49 +0000 (18:34 +0100)] 
[3.12] Fix typos in docs and comments (#109619) (#109621)

Fix typos in docs and comments (#109619)

Co-authored-by: Heinz-Alexander Fuetterer <35225576+afuetterer@users.noreply.github.com>
2 years ago[3.12] Code: Update Donghee Na's name (GH-109744) (#110225)
Miss Islington (bot) [Mon, 2 Oct 2023 17:31:34 +0000 (10:31 -0700)] 
[3.12] Code: Update Donghee Na's name (GH-109744) (#110225)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years ago[3.12] gh-110178: Use fewer weakrefs in test_typing.py (GH-110194) (#110224)
Miss Islington (bot) [Mon, 2 Oct 2023 17:15:30 +0000 (10:15 -0700)] 
[3.12] gh-110178: Use fewer weakrefs in test_typing.py (GH-110194) (#110224)

gh-110178: Use fewer weakrefs in test_typing.py (GH-110194)

Confirmed that without the C changes from GH-108517, this test still segfaults with only 10 weakrefs.
(cherry picked from commit 732ad44cec971be5255b1accbac6555d3615c2bf)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years ago[3.12] 3.12 What's New: Remove duplicate "up to" (GH-110219) (#110220)
Miss Islington (bot) [Mon, 2 Oct 2023 15:48:57 +0000 (08:48 -0700)] 
[3.12] 3.12 What's New: Remove duplicate "up to" (GH-110219) (#110220)

3.12 What's New: Remove duplicate "up to" (GH-110219)
(cherry picked from commit 8d92b6eff3bac45e7d4871c46c4511218b9b685a)

Co-authored-by: numbermaniac <5206120+numbermaniac@users.noreply.github.com>
2 years ago[3.12] gh-108963: using random to generate unique string in sys.intern test … (#110216)
Victor Stinner [Mon, 2 Oct 2023 15:48:42 +0000 (17:48 +0200)] 
[3.12] gh-108963: using random to generate unique string in sys.intern test … (#110216)

gh-108963: using random to generate unique string in sys.intern test (#109491)

(cherry picked from commit 44b1e4ea4842c6cdc1bedba7aaeb93f236b3ec08)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2 years ago[3.12] gh-109590: Update shutil.which on Windows to prefer a PATHEXT extension on...
Miss Islington (bot) [Mon, 2 Oct 2023 15:48:30 +0000 (08:48 -0700)] 
[3.12] gh-109590: Update shutil.which on Windows to prefer a PATHEXT extension on executable files (GH-109995) (#110202)

gh-109590: Update shutil.which on Windows to prefer a PATHEXT extension on executable files (GH-109995)

The default arguments for shutil.which() request an executable file, but extensionless files are not executable on Windows and should be ignored.
(cherry picked from commit 29b875bb93099171aeb7a60cd18d4e1f4ea3c1db)

Co-authored-by: Charles Machalow <csm10495@gmail.com>
2 years ago[3.12] gh-110160: Fix flaky `test_find_periodic_pattern` in `string_tests` (GH-110170...
Miss Islington (bot) [Mon, 2 Oct 2023 15:48:17 +0000 (08:48 -0700)] 
[3.12] gh-110160: Fix flaky `test_find_periodic_pattern` in `string_tests` (GH-110170) (#110182)

gh-110160: Fix flaky `test_find_periodic_pattern` in `string_tests` (GH-110170)
(cherry picked from commit 06faa9a39bd93c5e7999d52b52043ecdd0774dac)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-109649: Enhance os.cpu_count() documentation (#110169)
Victor Stinner [Mon, 2 Oct 2023 15:47:57 +0000 (17:47 +0200)] 
[3.12] gh-109649: Enhance os.cpu_count() documentation (#110169)

* gh-109649: Enhance os.cpu_count() documentation

* Doc: Specify that os.cpu_count() counts *logicial* CPUs.
* Doc: Specify that os.sched_getaffinity(0) is related to the calling
  thread.
* Fix test_posix.test_sched_getaffinity(): restore the old CPU mask
  when the test completes!

* Restore removed text

2 years ago[3.12] gh-110088: Fix asyncio test_prompt_cancellation() (GH-110157) (#110158)
Miss Islington (bot) [Mon, 2 Oct 2023 15:47:41 +0000 (08:47 -0700)] 
[3.12] gh-110088: Fix asyncio test_prompt_cancellation() (GH-110157) (#110158)

gh-110088: Fix asyncio test_prompt_cancellation() (GH-110157)

Don't measure the CI performance: don't test the maximum elapsed
time. The check failed on a slow CI.
(cherry picked from commit c62b49ecc8da13fa9522865ef6fe0aec194fd0d8)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] Add example for linear_regression() with proportional=True. (gh-110133) (...
Miss Islington (bot) [Mon, 2 Oct 2023 15:47:28 +0000 (08:47 -0700)] 
[3.12] Add example for linear_regression() with proportional=True. (gh-110133) (#110134)

Add example for linear_regression() with proportional=True. (gh-110133)
(cherry picked from commit 613c0d4e866341e15a66704643a6392ce49058ba)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2 years ago[3.12] gh-109047: concurrent.futures catches RuntimeError (#109810) (#110126)
Victor Stinner [Mon, 2 Oct 2023 15:47:10 +0000 (17:47 +0200)] 
[3.12] gh-109047: concurrent.futures catches RuntimeError (#109810) (#110126)

gh-109047: concurrent.futures catches PythonFinalizationError (#109810)

concurrent.futures: The *executor manager thread* now catches
exceptions when adding an item to the *call queue*. During Python
finalization, creating a new thread can now raise RuntimeError. Catch
the exception and call terminate_broken() in this case.

Add test_python_finalization_error() to test_concurrent_futures.

concurrent.futures._ExecutorManagerThread changes:

* terminate_broken() no longer calls shutdown_workers() since the
  call queue is no longer working anymore (read and write ends of
  the queue pipe are closed).
* terminate_broken() now terminates child processes, not only
  wait until they complete.
* _ExecutorManagerThread.terminate_broken() now holds shutdown_lock
  to prevent race conditons with ProcessPoolExecutor.submit().

multiprocessing.Queue changes:

* Add _terminate_broken() method.
* _start_thread() sets _thread to None on exception to prevent
  leaking "dangling threads" even if the thread was not started
  yet.

(cherry picked from commit 635184212179b0511768ea1cd57256e134ba2d75)

2 years ago[3.12] gh-109592: test_eintr tolerates 20 ms when comparing timings (GH-110102) ...
Miss Islington (bot) [Mon, 2 Oct 2023 15:46:45 +0000 (08:46 -0700)] 
[3.12] gh-109592: test_eintr tolerates 20 ms when comparing timings (GH-110102) (#110106)

gh-109592: test_eintr tolerates 20 ms when comparing timings (GH-110102)
(cherry picked from commit 9c73a9acec095c05a178e7dff638f7d9769318f3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-110052: Fix faulthandler for freed tstate (#110069) (#110071)
Victor Stinner [Mon, 2 Oct 2023 15:44:51 +0000 (17:44 +0200)] 
[3.12] gh-110052: Fix faulthandler for freed tstate (#110069) (#110071)

gh-110052: Fix faulthandler for freed tstate (#110069)

faulthandler now detected freed interp and freed tstate, and no
longer dereference them.

(cherry picked from commit 2e37a38bcbfbe1357436e030538290e7d00b668d)

2 years ago[3.12] gh-110036: multiprocessing Popen.terminate() catches PermissionError (GH-11003...
Miss Islington (bot) [Mon, 2 Oct 2023 15:44:26 +0000 (08:44 -0700)] 
[3.12] gh-110036: multiprocessing Popen.terminate() catches PermissionError (GH-110037) (#110064)

gh-110036: multiprocessing Popen.terminate() catches PermissionError (GH-110037)

On Windows, multiprocessing Popen.terminate() now catchs
PermissionError and get the process exit code. If the process is
still running, raise again the PermissionError. Otherwise, the
process terminated as expected: store its exit code.
(cherry picked from commit bd4518c60c9df356cf5e05b81305e3644ebb5e70)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109960: Remove test_pty timeout of 10 seconds (GH-110058) (#110060)
Miss Islington (bot) [Mon, 2 Oct 2023 15:43:38 +0000 (08:43 -0700)] 
[3.12] gh-109960: Remove test_pty timeout of 10 seconds (GH-110058) (#110060)

gh-109960: Remove test_pty timeout of 10 seconds (GH-110058)

In 2003, test_pty got a hardcoded timeout of 10 seconds to prevent
hanging on AIX & HPUX "if run after test_openpty":
commit 7d8145268ee282f14d6adce9305dc3c1c7ffec14. Since 2003, test_pty
was no longer reported to hang on AIX. But today, the test can fail
simply because a CI is busy running other tests in parallel.
The timeout of 10 seconds is no longer needed, just remove it.
Moreover, regrtest now has multiple built-in generic timeout
mecanisms.
(cherry picked from commit 5fdcea744024c8a19ddb57057bf5ec2889546c98)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109889: fix compiler's redundant NOP detection to look past NOPs with no...
Miss Islington (bot) [Mon, 2 Oct 2023 15:43:16 +0000 (08:43 -0700)] 
[3.12] gh-109889: fix compiler's redundant NOP detection to look past NOPs with no lineno when looking for the next instruction's lineno (GH-109987) (#110048)

gh-109889: fix compiler's redundant NOP detection to look past NOPs with no lineno when looking for the next instruction's lineno (GH-109987)
(cherry picked from commit f580edcc6a4c528020afe46c753db713474acad6)

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