]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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>
2 years ago[3.12] gh-110038: KqueueSelector must count all read/write events (GH-110039) (#110043)
Davide Rizzo [Mon, 2 Oct 2023 15:42:55 +0000 (17:42 +0200)] 
[3.12] gh-110038: KqueueSelector must count all read/write events (GH-110039) (#110043)

[3.12] gh-110038: KqueueSelector must count all read/write events (GH-110039).
(cherry picked from commit b14f0ab51cb4851b25935279617e388456dcf716)

2 years ago[3.12] gh-110033: Fix signal test_interprocess_signal() (GH-110035) (#110040)
Miss Islington (bot) [Mon, 2 Oct 2023 15:42:40 +0000 (08:42 -0700)] 
[3.12] gh-110033: Fix signal test_interprocess_signal() (GH-110035) (#110040)

gh-110033: Fix signal test_interprocess_signal() (GH-110035)

Fix test_interprocess_signal() of test_signal. Make sure that the
subprocess.Popen object is deleted before the test raising an
exception in a signal handler. Otherwise, Popen.__del__() can get the
exception which is logged as "Exception ignored in: ...." and the
test fails.
(cherry picked from commit 7e0fbf5175fcf21dae390ba68b7f49706d62aa49)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109594: Fix concurrent.futures test_timeout() (GH-110018) (#110021)
Miss Islington (bot) [Mon, 2 Oct 2023 15:42:03 +0000 (08:42 -0700)] 
[3.12] gh-109594: Fix concurrent.futures test_timeout() (GH-110018) (#110021)

gh-109594: Fix concurrent.futures test_timeout() (GH-110018)

Fix test_timeout() of test_concurrent_futures.test_wait. Remove the
future which may or may not complete depending if it takes longer
than the timeout ot not. Keep the second future which does not
complete before wait(). Make also the test faster: 0.5 second instead
of 6 seconds, so remove @support.requires_resource('walltime')
decorator.
(cherry picked from commit 9be283e5e15d5d5685b78a38eb132501f7f3febb)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109818: `reprlib.recursive_repr` copies `__type_params__` (… (#109999)
Jelle Zijlstra [Mon, 2 Oct 2023 15:41:26 +0000 (08:41 -0700)] 
[3.12] gh-109818: `reprlib.recursive_repr` copies `__type_params__` (… (#109999)

[3.12] gh-109818: `reprlib.recursive_repr` copies `__type_params__` (GH-109819).
(cherry picked from commit f65f9e80fe741c894582a3e413d4e3318c1ed626)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-109955 : Update state transition comments for asyncio.Task (GH-109910)...
Miss Islington (bot) [Mon, 2 Oct 2023 15:41:12 +0000 (08:41 -0700)] 
[3.12] gh-109955 : Update state transition comments for asyncio.Task (GH-109910) (#109992)

gh-109955 : Update state transition comments for asyncio.Task (GH-109910)
(cherry picked from commit 45cf5b0c69bb5c51f33fc681d90c45147e311ddf)

Co-authored-by: KristjΓ΅n Valur JΓ³nsson <sweskman@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2 years ago[3.12] gh-109565: Fix concurrent.futures test_future_times_out() (GH-109949) (#109952)
Miss Islington (bot) [Mon, 2 Oct 2023 15:40:16 +0000 (08:40 -0700)] 
[3.12] gh-109565: Fix concurrent.futures test_future_times_out() (GH-109949) (#109952)

gh-109565: Fix concurrent.futures test_future_times_out() (GH-109949)

as_completed() uses a timeout of 100 ms instead of 10 ms. Windows
monotonic clock resolution is around 15.6 ms.
(cherry picked from commit b1aebf1e6576680d606068d17e2208259573e061)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109615: Fix test_tools.test_freeze SRCDIR (#109935) (#109950)
Victor Stinner [Mon, 2 Oct 2023 15:40:02 +0000 (17:40 +0200)] 
[3.12] gh-109615: Fix test_tools.test_freeze SRCDIR (#109935) (#109950)

gh-109615: Fix test_tools.test_freeze SRCDIR (#109935)

Fix copy_source_tree() function of test_tools.test_freeze:

* Don't copy SRC_DIR/build/ anymore. This directory is modified by
  other tests running in parallel.
* Add test.support.copy_python_src_ignore().
* Use sysconfig to get the source directory.
* Use sysconfig.get_config_var() to get CONFIG_ARGS variable.

(cherry picked from commit 1512d6c6ee2a770afb339bbb74c1b990116f7f89)

2 years ago[3.12] Remove loop from docstring for asyncio.streams.open_connection (GH-108528...
Miss Islington (bot) [Mon, 2 Oct 2023 15:39:34 +0000 (08:39 -0700)] 
[3.12] Remove loop from docstring for asyncio.streams.open_connection (GH-108528) (#109941)

Remove loop from docstring for asyncio.streams.open_connection (GH-108528)
(cherry picked from commit e721f7a95186452339dc9e57630d639d549b2521)

Co-authored-by: Tom Gillespie <tgbugs@gmail.com>
2 years ago[3.12] gh-109098: Fuzz re module instead of internal sre (GH-109911) (#109932)
Miss Islington (bot) [Mon, 2 Oct 2023 15:39:07 +0000 (08:39 -0700)] 
[3.12] gh-109098: Fuzz re module instead of internal sre (GH-109911) (#109932)

gh-109098: Fuzz re module instead of internal sre (GH-109911)

* gh-109098: Fuzz re module instead of internal sre
* Fix c-analyzer globals test failure
* Put globals exception in ignored.tsv
(cherry picked from commit a829356f86d597e4dfe92e236a6d711c8a464f16)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2 years ago[3.12] gh-109845: Make test_ftplib more stable under load (GH-109912) (#109919)
Miss Islington (bot) [Mon, 2 Oct 2023 15:38:07 +0000 (08:38 -0700)] 
[3.12] gh-109845: Make test_ftplib more stable under load (GH-109912) (#109919)

gh-109845: Make test_ftplib more stable under load (GH-109912)

recv() can return partial data cut in the middle of a multibyte
character. Test raw binary data instead of data incorrectly decoded by parts.
(cherry picked from commit 2ef2fffe3be953b91852585c75188d5475b09474)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] More informative docstrings in the random module (gh-109745) (#109905)
Miss Islington (bot) [Mon, 2 Oct 2023 15:37:56 +0000 (08:37 -0700)] 
[3.12] More informative docstrings in the random module (gh-109745) (#109905)

More informative docstrings in the random module (gh-109745)
(cherry picked from commit 19bf3986958fc8269a1eb6d741bb60c91d6b5e58)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2 years ago[3.12] gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (GH-109629...
Miss Islington (bot) [Mon, 2 Oct 2023 15:37:40 +0000 (08:37 -0700)] 
[3.12] gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (GH-109629) (#109898)

gh-109593: Fix reentrancy issue in multiprocessing resource_tracker (GH-109629)

---------

(cherry picked from commit 0eb98837b60bc58e57ad3e2b35c6b0e9ab634678)

Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 years ago[3.12] gh-109832: concurrent.futures test_deadlock restores sys.stderr (GH-109887...
Miss Islington (bot) [Mon, 2 Oct 2023 15:37:25 +0000 (08:37 -0700)] 
[3.12] gh-109832: concurrent.futures test_deadlock restores sys.stderr (GH-109887) (#109892)

gh-109832: concurrent.futures test_deadlock restores sys.stderr (GH-109887)

test_error_at_task_unpickle() and
test_error_during_result_unpickle_in_result_handler() now restore
sys.stderr which is overriden by _raise_error_ignore_stderr().
(cherry picked from commit 2897142d2ec0930a8991af964c798b68fb6dcadd)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109631: Allow interruption of short repeated regex matches (GH-109867)...
Miss Islington (bot) [Mon, 2 Oct 2023 15:36:29 +0000 (08:36 -0700)] 
[3.12] gh-109631: Allow interruption of short repeated regex matches (GH-109867) (#109886)

gh-109631: Allow interruption of short repeated regex matches (GH-109867)

Counting for signal checking now continues in new match from the point where
it ended in the previous match instead of starting from 0.
(cherry picked from commit 8ac2085b80eca4d9b2a1093d0a7da020fd12e11a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-89363: Skip threading test_is_alive_after_fork() if ASAN (GH-109835) (...
Miss Islington (bot) [Mon, 2 Oct 2023 15:36:04 +0000 (08:36 -0700)] 
[3.12] gh-89363: Skip threading test_is_alive_after_fork() if ASAN (GH-109835) (#109855)

gh-89363: Skip threading test_is_alive_after_fork() if ASAN (GH-109835)

Skip test_is_alive_after_fork() of test_threading if Python is built
with Address Sanitizer (ASAN).
(cherry picked from commit bc06743533b5fea2d5ecdad6dd3caa372c67439f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109702: Increase concurrent_futures deadlock timeout (GH-109703) (#109705)
Miss Islington (bot) [Mon, 2 Oct 2023 15:35:36 +0000 (08:35 -0700)] 
[3.12] gh-109702: Increase concurrent_futures deadlock timeout (GH-109703) (#109705)

gh-109702: Increase concurrent_futures deadlock timeout (GH-109703)

Replace SHORT_TIMEOUT with LONG_TIMEOUT in test_deadlock of
test_concurrent_futures.
(cherry picked from commit 1eb1b45183c3b8aeefe3d5d27694155741e82bbc)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109625: Move _ready_to_import() from test_import to support.import_helper...
Miss Islington (bot) [Mon, 2 Oct 2023 15:35:03 +0000 (08:35 -0700)] 
[3.12] gh-109625: Move _ready_to_import() from test_import to support.import_helper (GH-109626) (#109640)

gh-109625: Move _ready_to_import() from test_import to support.import_helper (GH-109626)
(cherry picked from commit 115c49ad5a5ccfb628fef3ae06a566f7a0197f97)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-109833: Fix asyncio test_wait_for() (GH-109834) (#109837)
Miss Islington (bot) [Mon, 2 Oct 2023 15:24:51 +0000 (08:24 -0700)] 
[3.12] gh-109833: Fix asyncio test_wait_for() (GH-109834) (#109837)

gh-109833: Fix asyncio test_wait_for() (GH-109834)

Expect the test to be "short" but don't measure the exact performance
of the CI. SHORT_TIMEOUT is about 30 seconds whereas the cancelled
coroutine takes around 1 hour.
(cherry picked from commit f29bc9c9a0a6794c6b8a9e84a7ba9237b427a10a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-105829: Fix concurrent.futures.ProcessPoolExecutor deadlock (GH-108513...
elfstrom [Mon, 2 Oct 2023 15:24:19 +0000 (17:24 +0200)] 
[3.12] gh-105829: Fix concurrent.futures.ProcessPoolExecutor deadlock (GH-108513) (#109784)

This fixes issue GH-105829, https://github.com/python/cpython/issues/105829
(cherry picked from commit 405b06375a8a4cdb08ff53afade09a8b66ec23d5)

2 years ago[3.12] gh-109521: Fix obscure cases handling in PyImport_GetImporter() (GH-109522...
Miss Islington (bot) [Mon, 2 Oct 2023 15:22:40 +0000 (08:22 -0700)] 
[3.12] gh-109521: Fix obscure cases handling in PyImport_GetImporter() (GH-109522) (#109777)

gh-109521: Fix obscure cases handling in PyImport_GetImporter() (GH-109522)

PyImport_GetImporter() now sets RuntimeError if it fails to get sys.path_hooks
or sys.path_importer_cache or they are not list and dict correspondingly.

Previously it could return NULL without setting error in obscure cases,
crash or raise SystemError if these attributes have wrong type.
(cherry picked from commit 62c7015e89cbdedb5218d4fedd45f971885f67a8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-109706: Fix multiprocessing test_nested_startmethod() (GH-109707) (#109762)
Miss Islington (bot) [Mon, 2 Oct 2023 15:22:16 +0000 (08:22 -0700)] 
[3.12] gh-109706: Fix multiprocessing test_nested_startmethod() (GH-109707) (#109762)

gh-109706: Fix multiprocessing test_nested_startmethod() (GH-109707)

Don't check order, queue items can be written in any order.
(cherry picked from commit b03a791497ff4b3c42805e06c73d08ac34087402)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109596: Ensure repeated rules in the grammar are not allowed and fix incorr...
Pablo Galindo Salgado [Mon, 2 Oct 2023 15:22:07 +0000 (16:22 +0100)] 
[3.12] gh-109596: Ensure repeated rules in the grammar are not allowed and fix incorrect soft keywords (GH-109606). (#109752)

(cherry picked from commit b28ffaa193efc66f46ab90d383279174a11a11d7)

2 years ago[3.12] gh-109709: Fix asyncio test_stdin_broken_pipe() (GH-109710) (#109731)
Miss Islington (bot) [Mon, 2 Oct 2023 15:21:51 +0000 (08:21 -0700)] 
[3.12] gh-109709: Fix asyncio test_stdin_broken_pipe() (GH-109710) (#109731)

gh-109709: Fix asyncio test_stdin_broken_pipe() (GH-109710)

Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().
(cherry picked from commit cbbdf2c1440c804adcfc32ea0470865b3b3b8eb2)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-106584: Fix exit code for unittest in Python 3.12 (GH-106588) (#109725)
Miss Islington (bot) [Mon, 2 Oct 2023 15:18:41 +0000 (08:18 -0700)] 
[3.12] gh-106584: Fix exit code for unittest in Python 3.12 (GH-106588) (#109725)

gh-106584: Fix exit code for unittest in Python 3.12 (GH-106588)
(cherry picked from commit 8fc071345b50dd3de61ebeeaa287ccef21d061b2)

Co-authored-by: EliseevEgor <egor.eliseev@jetbrains.com>
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#109697) (#109698)
Victor Stinner [Mon, 2 Oct 2023 15:16:25 +0000 (17:16 +0200)] 
[3.12] gh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#109697) (#109698)

gh-108948: Skip test_tarfile.test_modes() on EFTYPE error (#109697)

On FreeBSD, regular users cannot set the sticky bit. Skip the test if
chmod() fails with EFTYPE error.

(cherry picked from commit 26e06ad617bb416201c769fea91cd33d544c6a1c)

2 years ago[3.12] gh-109582: test_fork_signal_handling should wait for event (GH-109605) (#109695)
Miss Islington (bot) [Mon, 2 Oct 2023 15:14:30 +0000 (08:14 -0700)] 
[3.12] gh-109582: test_fork_signal_handling should wait for event (GH-109605) (#109695)

gh-109582: test_fork_signal_handling should wait for event (GH-109605)

Sometimes the child_handled event was missing because either
the child quits before it gets a chance to handle the signal,
or the parent asserts before the event notification is
delivered via IPC.  Synchronize explicitly to avoid this.
(cherry picked from commit 608c1f3083ea1e06d383ef1a9878a9758903de4b)

Co-authored-by: Davide Rizzo <sorcio@gmail.com>
2 years ago[3.12] gh-108303: Move `test_future` into its own test_future_stmt subdir (#109368...
Victor Stinner [Mon, 2 Oct 2023 15:12:54 +0000 (17:12 +0200)] 
[3.12] gh-108303: Move `test_future` into its own test_future_stmt subdir (#109368) (#109679)

gh-108303: Move `test_future` into its own test_future_stmt subdir (#109368)

(cherry picked from commit 82505dc351b2f7e37aa395218709b432d83292cd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265...
Victor Stinner [Mon, 2 Oct 2023 15:11:24 +0000 (17:11 +0200)] 
[3.12] gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265) (#109677)

* gh-108303: Move tokenize-related data to Lib/test/tokenizedata (GH-109265)

(cherry picked from commit 1110c5bc828218086f6397ec05a9312fb73ea30a)

* gh-108303: Add `Lib/test/tokenizedata` to `TESTSUBDIRS` (#109314)

(cherry picked from commit 42ab2cbd7b5e76e919b70883ae683e789dbd913d)

---------

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-108303: Create Lib/test/test_dataclasses/ directory (GH-108978) (#109674)
Miss Islington (bot) [Mon, 2 Oct 2023 15:11:03 +0000 (08:11 -0700)] 
[3.12] gh-108303: Create Lib/test/test_dataclasses/ directory (GH-108978) (#109674)

* gh-108303: Create Lib/test/test_dataclasses/ directory (GH-108978)

Move test_dataclasses.py and its "dataclass_*.py" modules into the
new Lib/test/test_dataclasses/ subdirectory.
(cherry picked from commit 14d6e197cc56e5256d501839a4e66e3864ab15f0)

Co-authored-by: Victor Stinner <vstinner@python.org>
* Fix Lint job: update Lib/test/.ruff.toml

---------

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (GH-108354...
Miss Islington (bot) [Mon, 2 Oct 2023 15:10:33 +0000 (08:10 -0700)] 
[3.12] gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (GH-108354) (#109672)

gh-108303: Move `ann_module*.py` files to `typinganndata/` folder (GH-108354)
(cherry picked from commit 3f61cf646d0506baa0c0c2118f05110446519c62)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-108303: Remove unused Lib/test/sgml_input.html (GH-108305) (#109671)
Miss Islington (bot) [Mon, 2 Oct 2023 15:10:04 +0000 (08:10 -0700)] 
[3.12] gh-108303: Remove unused Lib/test/sgml_input.html (GH-108305) (#109671)

gh-108303: Remove unused Lib/test/sgml_input.html (GH-108305)

In Python 2.7, the file was used by Lib/test/test_sgmllib.py to test
Lib/sgmllib.py. The sgmllib module and its tests have been removed in
Python 3.0.
(cherry picked from commit d2879f2095abd5c8186c7f69c964a341c2053572)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109613: _pystat_fromstructstat() checks for exceptions (GH-109618) (#109641)
Miss Islington (bot) [Mon, 2 Oct 2023 15:09:45 +0000 (08:09 -0700)] 
[3.12] gh-109613: _pystat_fromstructstat() checks for exceptions (GH-109618) (#109641)

gh-109613: _pystat_fromstructstat() checks for exceptions (GH-109618)

Fix os.stat() and os.DirEntry.stat(): check for exceptions.
Previously, on Python built in debug mode, these functions could
trigger a fatal Python error (and abort the process) when a function
succeeded with an exception set.

_pystat_fromstructstat() now exits immediately if an exception is
raised, rather only checking for exceptions at the end. It fix
following fatal error in fill_time():

    Fatal Python error: _Py_CheckSlotResult:
    Slot * of type int succeeded with an exception set
(cherry picked from commit d4cea794a7b9b745817d2bd982d35412aef04710)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-103053: Skip test_freeze_simple_script() on PGO build (#109591) (#109614)
Victor Stinner [Mon, 2 Oct 2023 15:04:19 +0000 (17:04 +0200)] 
[3.12] gh-103053: Skip test_freeze_simple_script() on PGO build (#109591) (#109614)

gh-103053: Skip test_freeze_simple_script() on PGO build (#109591)

Skip test_freeze_simple_script() of test_tools.test_freeze if Python
is built with "./configure --enable-optimizations", which means with
Profile Guided Optimization (PGO): it just makes the test too slow.
The freeze tool is tested by many other CIs with other (faster)
compiler flags.

test.pythoninfo now gets also get_build_info() of
test.libregrtests.utils.

(cherry picked from commit 81cd1bd713624c3d26b647f3d28f2fd905887a0d)

2 years ago[3.12] gh-108973: Fix asyncio test_subprocess_consistent_callbacks() (GH-109431)...
Miss Islington (bot) [Mon, 2 Oct 2023 15:03:51 +0000 (08:03 -0700)] 
[3.12] gh-108973: Fix asyncio test_subprocess_consistent_callbacks() (GH-109431) (#109609)

gh-108973: Fix asyncio test_subprocess_consistent_callbacks() (GH-109431)

SubprocessProtocol process_exited() method can be called before
pipe_data_received() and pipe_connection_lost() methods. Document it
and adapt the test for that.

Revert commit 282edd7b2a74c4dfe1bfe3c5b1d30f9c21d554d6.
_child_watcher_callback() calls immediately _process_exited(): don't
add an additional delay with call_soon(). The reverted change didn't
make _process_exited() more determistic: it can still be called
before pipe_connection_lost() for example.

(cherry picked from commit ced6924630037f1e5b3d1dbef2b600152fb07fbb)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Davide Rizzo <sorcio@gmail.com>
2 years ago[3.12] gh-109580: Skip test_perf_profiler on ASAN build (GH-109584) (#109585)
Miss Islington (bot) [Mon, 2 Oct 2023 15:00:11 +0000 (08:00 -0700)] 
[3.12] gh-109580: Skip test_perf_profiler on ASAN build (GH-109584) (#109585)

gh-109580: Skip test_perf_profiler on ASAN build (GH-109584)

Skip test_perf_profiler if Python is built with ASAN, MSAN or UBSAN
sanitizer. Python does crash randomly in this test on such build.
(cherry picked from commit 754519a9f8c2bb06d85ff9b3e9fe6f967ac46d5c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-109469: Silence compiler warnings on string comparisons in _testcapi (GH...
Miss Islington (bot) [Mon, 2 Oct 2023 14:59:43 +0000 (07:59 -0700)] 
[3.12] gh-109469: Silence compiler warnings on string comparisons in _testcapi (GH-109533) (#109558)

gh-109469: Silence compiler warnings on string comparisons in _testcapi (GH-109533)
(cherry picked from commit ed582a2ed980efba2d0da365ae37bff4a2b99873)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-109546: Add more tests for formatting floats and fractions (GH-109548)...
Miss Islington (bot) [Mon, 2 Oct 2023 14:59:26 +0000 (07:59 -0700)] 
[3.12] gh-109546: Add more tests for formatting floats and fractions (GH-109548) (#109557)

gh-109546: Add more tests for formatting floats and fractions (GH-109548)
(cherry picked from commit beb5ec5817b645562ebbdd59f25683a93061c32c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] Fix error handling in _PySys_UpdateConfig() (GH-109524) (#109550)
Miss Islington (bot) [Mon, 2 Oct 2023 14:58:58 +0000 (07:58 -0700)] 
[3.12] Fix error handling in _PySys_UpdateConfig() (GH-109524) (#109550)

Fix error handling in _PySys_UpdateConfig() (GH-109524)
(cherry picked from commit c829975428253568d47ebfc3104fa7386b5e0b58)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] Fix date.__repr__() docstring (GH-109422) (#109448)
Miss Islington (bot) [Mon, 2 Oct 2023 14:58:43 +0000 (07:58 -0700)] 
[3.12] Fix date.__repr__() docstring (GH-109422) (#109448)

Fix date.__repr__() docstring (GH-109422)
(cherry picked from commit 5eec58a9e57383128ade7b527965b1efc474735b)

Co-authored-by: Christopher Yeh <chrisyeh96@users.noreply.github.com>
2 years ago[3.12] gh-109375: Fix bug where pdb registers an alias without an associated command...
Miss Islington (bot) [Mon, 2 Oct 2023 14:58:22 +0000 (07:58 -0700)] 
[3.12] gh-109375: Fix bug where pdb registers an alias without an associated command (GH-109376) (#109429)

gh-109375: Fix bug where pdb registers an alias without an associated command (GH-109376)
(cherry picked from commit 68a6f21f47e779ddd70e33cf04d170a63f077fcd)

Co-authored-by: buermarc <44375277+buermarc@users.noreply.github.com>
2 years ago[3.12] gh-109351: Fix crash when compiling AST with invalid NamedExpr (GH-109352...
Miss Islington (bot) [Mon, 2 Oct 2023 14:58:06 +0000 (07:58 -0700)] 
[3.12] gh-109351: Fix crash when compiling AST with invalid NamedExpr (GH-109352) (#109379)

gh-109351: Fix crash when compiling AST with invalid NamedExpr (GH-109352)
(cherry picked from commit 79101edb03b7381b514126c68acabfcbbba2f842)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2 years ago[3.12] gh-84867: Do not load tests from TestCase and FunctionTestCase (GH-100497...
Miss Islington (bot) [Mon, 2 Oct 2023 14:57:44 +0000 (07:57 -0700)] 
[3.12] gh-84867: Do not load tests from TestCase and FunctionTestCase (GH-100497) (#109327)

gh-84867: Do not load tests from TestCase and FunctionTestCase (GH-100497)
(cherry picked from commit 66d1d7eb067d445f1ade151f4a6db3864dd9109f)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years ago[3.12] gh-109179: Fix traceback display for SyntaxErrors with notes (#109197) (#109280)
Irit Katriel [Mon, 2 Oct 2023 14:56:34 +0000 (15:56 +0100)] 
[3.12] gh-109179: Fix traceback display for SyntaxErrors with notes (#109197) (#109280)

(cherry picked from commit ecd21a629a2a30bcae89902f7cad5670e9441e2c)

2 years ago[3.12] gh-107219: Fix concurrent.futures terminate_broken() (GH-109244) (#109254)
Miss Islington (bot) [Mon, 2 Oct 2023 14:56:09 +0000 (07:56 -0700)] 
[3.12] gh-107219: Fix concurrent.futures terminate_broken() (GH-109244) (#109254)

gh-107219: Fix concurrent.futures terminate_broken() (GH-109244)

Fix a race condition in concurrent.futures. When a process in the
process pool was terminated abruptly (while the future was running or
pending), close the connection write end. If the call queue is
blocked on sending bytes to a worker process, closing the connection
write end interrupts the send, so the queue can be closed.

Changes:

* _ExecutorManagerThread.terminate_broken() now closes
  call_queue._writer.
* multiprocessing PipeConnection.close() now interrupts
  WaitForMultipleObjects() in _send_bytes() by cancelling the
  overlapped operation.
(cherry picked from commit a9b1f84790e977fb09f75b148c4c4f5924a6ef99)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years ago[3.12] gh-50644: Forbid pickling of codecs streams (GH-109180) (#109231)
Miss Islington (bot) [Mon, 2 Oct 2023 14:55:52 +0000 (07:55 -0700)] 
[3.12] gh-50644: Forbid pickling of codecs streams (GH-109180) (#109231)

gh-50644: Forbid pickling of codecs streams (GH-109180)

Attempts to pickle or create a shallow or deep copy of codecs streams
now raise a TypeError.

Previously, copying failed with a RecursionError, while pickling
produced wrong results that eventually caused unpickling to fail with
a RecursionError.
(cherry picked from commit d6892c2b9263b39ea1c7905667942914b6a24b2c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-109207: Fix SystemError when printing symtable entry object. (GH-109225...
Miss Islington (bot) [Mon, 2 Oct 2023 14:55:41 +0000 (07:55 -0700)] 
[3.12] gh-109207: Fix SystemError when printing symtable entry object. (GH-109225) (#109227)

gh-109207: Fix SystemError when printing symtable entry object. (GH-109225)
(cherry picked from commit 429749969621b149c1a7c3c004bd44f52bec8f44)

Co-authored-by: δΊ‘line <31395137+yunline@users.noreply.github.com>
2 years ago[3.12] Check the result of PySet_Contains() for error in Python/symtable.c (GH-109146...
Miss Islington (bot) [Mon, 2 Oct 2023 14:55:24 +0000 (07:55 -0700)] 
[3.12] Check the result of PySet_Contains() for error in Python/symtable.c (GH-109146) (#109153)

Check the result of PySet_Contains() for error in Python/symtable.c (GH-109146)
(cherry picked from commit 87a7faf6b68c8076e640a9a1347a255f132d8382)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years ago[3.12] gh-104690: thread_run() checks for tstate dangling pointer (#109056) (#109133)
Victor Stinner [Mon, 2 Oct 2023 14:55:06 +0000 (16:55 +0200)] 
[3.12] gh-104690: thread_run() checks for tstate dangling pointer (#109056) (#109133)

gh-104690: thread_run() checks for tstate dangling pointer (#109056)

thread_run() of _threadmodule.c now calls
_PyThreadState_CheckConsistency() to check if tstate is a dangling
pointer when Python is built in debug mode.

Rename ceval_gil.c is_tstate_valid() to
_PyThreadState_CheckConsistency() to reuse it in _threadmodule.c.

(cherry picked from commit f63d37877ad166041489a968233b57540f8456e8)

2 years ago[3.12] gh-88943: Improve syntax error for non-ASCII character that follows a numerica...
Miss Islington (bot) [Mon, 2 Oct 2023 14:54:16 +0000 (07:54 -0700)] 
[3.12] gh-88943: Improve syntax error for non-ASCII character that follows a numerical literal (GH-109081) (#109090)

gh-88943: Improve syntax error for non-ASCII character that follows a numerical literal (GH-109081)

It now points on the invalid non-ASCII character, not on the valid numerical literal.
(cherry picked from commit b2729e93e9d73503b1fda4ea4fecd77c58909091)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agoMerge branch '3.12' of https://github.com/python/cpython into 3.12
Thomas Wouters [Mon, 2 Oct 2023 14:44:26 +0000 (16:44 +0200)] 
Merge branch '3.12' of https://github.com/python/cpython into 3.12

2 years agoPost 3.12.0
Thomas Wouters [Mon, 2 Oct 2023 14:41:41 +0000 (16:41 +0200)] 
Post 3.12.0

2 years ago[3.12] gh-109496: Skip test_capi.test_decref_freed_object() on ASAN (GH-109573) ...
Miss Islington (bot) [Mon, 2 Oct 2023 14:09:35 +0000 (07:09 -0700)] 
[3.12] gh-109496: Skip test_capi.test_decref_freed_object() on ASAN (GH-109573) (#109578)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agoPython 3.12.0 v3.12.0
Thomas Wouters [Mon, 2 Oct 2023 11:44:36 +0000 (13:44 +0200)] 
Python 3.12.0

2 years ago[3.12] GH-109190: Announce final release in What's New in Python 3.12 (GH-110117...
Miss Islington (bot) [Mon, 2 Oct 2023 11:26:30 +0000 (04:26 -0700)] 
[3.12] GH-109190: Announce final release in What's New in Python 3.12 (GH-110117) (#110215)

GH-109190: Announce final release in What's New in Python 3.12 (GH-110117)

Prepare What's New in Python 3.12 for final release
(cherry picked from commit 6139bf5e0c755ed22bdfb027a5299493f0c71be9)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>