Commit graph

117957 commits

Author SHA1 Message Date
Miss Islington (bot)
b723b8a13d
[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 0eb98837b6)

Co-authored-by: Antoine Pitrou <antoine@python.org>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-10-02 17:37:40 +02:00
Miss Islington (bot)
84f9da9ab5
[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 2897142d2e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:37:25 +02:00
Miss Islington (bot)
65c845e065
[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 8ac2085b80)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-02 17:36:29 +02:00
Miss Islington (bot)
d09a3145b5
[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 bc06743533)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:36:04 +02:00
Miss Islington (bot)
e25bc38ebb
[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 1eb1b45183)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:35:36 +02:00
Miss Islington (bot)
8c5fd2105c
[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 115c49ad5a)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-02 17:35:03 +02:00
Miss Islington (bot)
150bd302bb
[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 f29bc9c9a0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:24:51 +02:00
elfstrom
c2cadb0ec2
[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 405b06375a)
2023-10-02 17:24:19 +02:00
Miss Islington (bot)
5e6e99646e
[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 62c7015e89)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-02 17:22:40 +02:00
Miss Islington (bot)
6a6bea3ee8
[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 b03a791497)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:22:16 +02:00
Pablo Galindo Salgado
f6cb2e4815
[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 b28ffaa193)
2023-10-02 17:22:07 +02:00
Miss Islington (bot)
c7cbd82e62
[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 cbbdf2c144)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:21:51 +02:00
Miss Islington (bot)
551aa6ab94
[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 8fc071345b)

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>
2023-10-02 17:18:41 +02:00
Victor Stinner
84ef145d85
[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 26e06ad617)
2023-10-02 17:16:25 +02:00
Miss Islington (bot)
05b139b599
[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 608c1f3083)

Co-authored-by: Davide Rizzo <sorcio@gmail.com>
2023-10-02 17:14:30 +02:00
Victor Stinner
5baa8af8da
[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 82505dc351)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-02 17:12:54 +02:00
Victor Stinner
ed4ffd7404
[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 1110c5bc82)

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

(cherry picked from commit 42ab2cbd7b)

---------

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-02 17:11:24 +02:00
Miss Islington (bot)
9bceb8a79b
[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 14d6e197cc)

Co-authored-by: Victor Stinner <vstinner@python.org>

* Fix Lint job: update Lib/test/.ruff.toml

---------

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:11:03 +02:00
Miss Islington (bot)
b153cab6d8
[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 3f61cf646d)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-02 17:10:33 +02:00
Miss Islington (bot)
1dfb41d262
[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 d2879f2095)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:10:04 +02:00
Miss Islington (bot)
47e96c6782
[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 d4cea794a7)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:09:45 +02:00
Victor Stinner
dc70d30732
[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 81cd1bd713)
2023-10-02 17:04:19 +02:00
Miss Islington (bot)
5ba9d2b98f
[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 282edd7b2a.
_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 ced6924630)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Davide Rizzo <sorcio@gmail.com>
2023-10-02 17:03:51 +02:00
Miss Islington (bot)
c3038bed1d
[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 754519a9f8)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 17:00:11 +02:00
Miss Islington (bot)
ddc0adcdb3
[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 ed582a2ed9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-02 16:59:43 +02:00
Miss Islington (bot)
acb6753233
[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 beb5ec5817)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-02 16:59:26 +02:00
Miss Islington (bot)
df2cdcf22f
[3.12] Fix error handling in _PySys_UpdateConfig() (GH-109524) (#109550)
Fix error handling in _PySys_UpdateConfig() (GH-109524)
(cherry picked from commit c829975428)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-02 16:58:58 +02:00
Miss Islington (bot)
e5c860f9d0
[3.12] Fix date.__repr__() docstring (GH-109422) (#109448)
Fix date.__repr__() docstring (GH-109422)
(cherry picked from commit 5eec58a9e5)

Co-authored-by: Christopher Yeh <chrisyeh96@users.noreply.github.com>
2023-10-02 16:58:43 +02:00
Miss Islington (bot)
775fd782fc
[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 68a6f21f47)

Co-authored-by: buermarc <44375277+buermarc@users.noreply.github.com>
2023-10-02 16:58:22 +02:00
Miss Islington (bot)
4b2ba3d0b8
[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 79101edb03)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-10-02 16:58:06 +02:00
Miss Islington (bot)
2fb39f73ed
[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 66d1d7eb06)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-02 16:57:44 +02:00
Irit Katriel
a8431123c2
[3.12] gh-109179: Fix traceback display for SyntaxErrors with notes (#109197) (#109280)
(cherry picked from commit ecd21a629a)
2023-10-02 16:56:34 +02:00
Miss Islington (bot)
1d8c18c39d
[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 a9b1f84790)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 16:56:09 +02:00
Miss Islington (bot)
3e1c9e8264
[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 d6892c2b92)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-02 16:55:52 +02:00
Miss Islington (bot)
be8255ad8c
[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 4297499696)

Co-authored-by: 云line <31395137+yunline@users.noreply.github.com>
2023-10-02 16:55:41 +02:00
Miss Islington (bot)
1c223ae58d
[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 87a7faf6b6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-02 16:55:24 +02:00
Victor Stinner
30748d36b3
[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 f63d37877a)
2023-10-02 16:55:06 +02:00
Miss Islington (bot)
9207c870be
[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 b2729e93e9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-02 16:54:16 +02:00
Thomas Wouters
a4f186ad49 Merge branch '3.12' of https://github.com/python/cpython into 3.12 2023-10-02 16:44:26 +02:00
Thomas Wouters
531d2df280 Post 3.12.0 2023-10-02 16:41:41 +02:00
Miss Islington (bot)
62d9ae414f
[3.12] gh-109496: Skip test_capi.test_decref_freed_object() on ASAN (GH-109573) (#109578)
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 15:09:35 +01:00
Thomas Wouters
0fb18b02c8 Python 3.12.0 2023-10-02 13:48:14 +02:00
Miss Islington (bot)
f4f919e3d8
[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 6139bf5e0c)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-10-02 13:26:30 +02:00
Miss Islington (bot)
8811f3d7f9
[3.12] Docs: bump Pygments to fix contrast ratios to meet WCAG AA guidelines (GH-110208) (#110210)
Docs: bump Pygments to fix contrast ratios to meet WCAG AA guidelines (GH-110208)
(cherry picked from commit 9cb8927bfc)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-10-02 12:50:52 +02:00
Miss Islington (bot)
48afd1cf17
[3.12] GH-92584: Move installation schemes overview to sysconfig docs (GH-108018) (#110213)
GH-92584: Move installation schemes overview to sysconfig docs (GH-108018)

* Add new installation path functions subsection

* Add content from install/index to sysconfig

* Fix table

* Update note about installers

* Clean up the list of schemes, remove references to Distutils
(cherry picked from commit f16e81f368)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-10-02 10:50:28 +00:00
Miss Islington (bot)
bb35fc3706
[3.12] gh-107888: Fix test_mmap.test_access_parameter() on macOS 14 (GH-109928) (#109929)
gh-107888: Fix test_mmap.test_access_parameter() on macOS 14 (GH-109928)
(cherry picked from commit 9dbfe2dc8e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-02 12:09:54 +02:00
Miss Islington (bot)
6f6ca1daa4
[3.12] GH-101100: Fix reference warnings for `namedtuple` (GH-110113) (#110135)
GH-101100: Fix reference warnings for ``namedtuple`` (GH-110113)
(cherry picked from commit cbdacc738a)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-10-02 12:07:58 +02:00
Miss Islington (bot)
b0a8cb2901
[3.12] gh-110138: Improve grammar in idiomatic usage of `__main__.py` (GH-110142) (#110188)
gh-110138: Improve grammar in idiomatic usage of ``__main__.py`` (GH-110142)
(cherry picked from commit adf0f15a06)

Co-authored-by: Quentin Agren <quentin.agren@gmail.com>
2023-10-02 12:03:12 +02:00
Hugo van Kemenade
96110e9429
[3.12] gh-101100: Fix sphinx warnings in library/site.rst (GH-110144) (#110187)
(cherry picked from commit 31097df611)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-10-02 12:02:29 +02:00
Miss Islington (bot)
54ffee0e51
[3.12] GH-101100: Fix reference warnings for `gettext` (GH-110115) (#110140)
GH-101100: Fix reference warnings for ``gettext`` (GH-110115)
(cherry picked from commit 0449fe999d)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-10-02 12:01:26 +02:00