125789 Commits

Author SHA1 Message Date
Jamie Phan
10cdd7f91f
GH-130903: typo in optimizer DSL for _GUARD_BOTH_UNICODE (#130904)
Typo introduced in gh-118910.
2025-03-06 12:11:08 +01:00
Tomasz Pytel
aeb2327386
gh-130574: renumber RESUME opcode from 149 to 128 (GH-130685) 2025-03-06 08:59:36 +00:00
Ken Jin
e4a60248b0
gh-128563: Add correction note to tail call in whats new (#130908)
* Add correction note to tail call in whats new

* Update 3.14.rst
2025-03-06 14:43:53 +08:00
Bartosz Sławecki
293fa3433e
gh-85795: Raise a clear error when super() is used in typing.NamedTuple subclasses (#130082) 2025-03-05 20:45:47 -08:00
Charles Machalow
5e73ece95e
gh-128041: Fix incorrect bullet placement in "What's new" (GH-130900) 2025-03-05 22:59:56 +00:00
Tshepang Mbambo
1b5db5adfe
GH-130153: Reword the wildcard matching part of the tutorial (GH-129954) 2025-03-05 14:59:47 -08:00
Charles Machalow
ba05a4ebcb
gh-128041: Add terminate_workers and kill_workers methods to ProcessPoolExecutor (GH-130849)
This adds two new methods to `multiprocessing`'s `ProcessPoolExecutor`:
- **`terminate_workers()`**: forcefully terminates worker processes using `Process.terminate()`
- **`kill_workers()`**: forcefully kills worker processes using `Process.kill()`

These methods provide users with a direct way to stop worker processes without `shutdown()` or relying on implementation details, addressing situations where immediate termination is needed.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Sam Gross @colesbury
Commit-message-mostly-authored-by: Claude Sonnet 3.7 (because why not -greg)
2025-03-05 14:31:42 -08:00
Diego Russo
02de9cb9a8
gh-129964: Fix JIT crash on Windows on Arm (GH-130882) 2025-03-05 12:40:50 -08:00
Brandt Bucher
5d8db36bbb
GH-115802: JIT using the "medium" code model on x86_64-unknown-linux-gnu (GH-130097) 2025-03-05 11:54:33 -08:00
mpage
d7bb7c7817
gh-118331: Fix a couple of issues when list allocation fails (#130811)
* Fix use after free in list objects

Set the items pointer in the list object to NULL after the items array
is freed during list deallocation. Otherwise, we can end up with a list
object added to the free list that contains a pointer to an already-freed
items array.

* Mark `_PyList_FromStackRefStealOnSuccess` as escaping

I think technically it's not escaping, because the only object that
can be decrefed if allocation fails is an exact list, which cannot
execute arbitrary code when it is destroyed. However, this seems less
intrusive than trying to special cases objects in the assert in `_Py_Dealloc`
that checks for non-null stackpointers and shouldn't matter for performance.
2025-03-05 10:42:09 -08:00
Burkov Egor
2904ec2273
gh-130878: Add extra check to prepare_ssl.py (GH-130879) 2025-03-05 17:08:30 +00:00
Sebastian Rittau
4f6218959e
Update links from typing.readthedocs.io to typing.python.org (#130877) 2025-03-05 17:26:44 +02:00
Sam Gross
2905690a91
gh-130851: Don't crash when deduping unusual code constants (#130853)
The bytecode compiler only generates a few different types of constants,
like str, int, tuple, slices, etc. Users can construct code objects with
various unusual constants, including ones that are not hashable or not
even constant.

The free threaded build previously crashed with a fatal error when
confronted with these constants. Instead, treat distinct objects of
otherwise unhandled types as not equal for the purposes of deduplication.
2025-03-05 15:04:49 +01:00
Mark Shannon
78d50e91ff
GH-127705: better double free message. (GH-130785)
* Add location information when accessing already closed stackref

* Add #def option to track closed stackrefs to provide precise information for use after free and double frees.
2025-03-05 14:00:42 +00:00
Serhiy Storchaka
f33d21e24f
gh-127750: Improve repr of functools.singledispatchmethod (GH-130220) 2025-03-05 13:10:05 +02:00
Victor Stinner
67a942d427
gh-116742: Fix subprocess test_check_output_timeout() (#130836)
Fix a race condition in test_check_output_timeout() of
test_subprocess. Don't write into stdout anymore, since there is no
reliable way to synchronize the parent and the child processes.

Change the timeout from 3 seconds to 0.1 seconds, and remove
@requires_resource('walltime') decorator.
2025-03-05 10:51:33 +00:00
Serhiy Storchaka
63d25f8d0c
gh-130824: Clean up test wrappers for PyLong_*AndOverflow functions (GH-130871) 2025-03-05 11:50:53 +01:00
Peter Bierma
90130807d9
gh-130824: Add tests for NULL in PyLong_*AndOverflow functions (GH-130828)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-03-05 09:58:39 +01:00
Adam Turner
e53d105872
GH-125722: Increase minimum supported Sphinx to 8.2.0 (#130444) 2025-03-05 00:31:01 +00:00
Sam Gross
2f6e0e9f70
gh-130794: Process interpreter QSBR queue in _PyMem_AbandonDelayed. (gh-130808)
This avoids a case where the interpreter's queue of memory to be freed
could grow rapidly if there are many short lived threads.
2025-03-04 18:04:04 -05:00
Bert Peters
cb67b44ca9
gh-127371 Avoid unbounded growth SpooledTempfile.writelines (GH-127372) 2025-03-05 00:06:07 +02:00
Amit Lavon
691354ccb0
GH-130415: Narrow str to "" based on boolean tests (GH-130476) 2025-03-04 13:20:17 -08:00
Tian Gao
b6769e9404
gh-125377: Improve tab indentation for pdb multi-line input (#130471) 2025-03-04 15:45:38 -05:00
Klaus117
c989e74446
GH-130415: Narrow int to 0 based on boolean tests (GH-130772) 2025-03-04 12:44:09 -08:00
Tian Gao
e20e47dda6
gh-130660: Add a test for pdb when user quits after interact command (#130852) 2025-03-04 15:10:32 -05:00
Jelle Zijlstra
dc6d66f44c
gh-105499: Merge typing.Union and types.UnionType (#105511)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2025-03-04 11:44:19 -08:00
Tomas R.
e091520fdb
gh-126085: Add tp_iter to TypeAliasType to allow star unpacking (#127981) 2025-03-04 11:34:59 -08:00
Chris Eibl
d8a1cf469e
gh-130090: Support PGO for clang-cl on Windows (GH-129907) 2025-03-04 19:29:03 +00:00
Victor Stinner
3dd3675492
gh-130730: Fix multiprocessing test_active_children() (#130837)
Replace a sleep with an event: sleep is not a reliable
synchronization primitive.
2025-03-04 17:05:20 +00:00
Mark Shannon
885c3d126f
GH-90916: Add helper function to dis.Instruction and use it to reduce churn in test_dis (GH-130643) 2025-03-04 16:43:39 +00:00
Tian Gao
63b6ec31c4
gh-82987: Stop on calling frame unconditionally for inline breakpoints (#130493) 2025-03-04 11:35:47 -05:00
Sam Gross
efadc5874c
Revert "gh-128041: Add terminate_workers and kill_workers methods to ProcessPoolExecutor (GH-128043)" (#130838)
The test_concurrent_futures.test_process_pool test is failing in CI.

This reverts commit f97e4098ff71a6488fd3411f9f9e6fa7a7bb4efe.
2025-03-04 11:19:06 -05:00
sobolevn
63ffb406bb
gh-129567: Add a note to typing.TypedDict docs about name mangling (#130233) 2025-03-04 18:15:00 +03:00
Victor Stinner
f67ff9e820
gh-130727: Retry test_wmi on TimeoutError (#130832)
Use sleeping_retry() in test_wmi to retry multiple times on
TimeoutError. Wait up to LONG_TIMEOUT seconds (5 minutes by default).
2025-03-04 16:07:01 +01:00
Jelle Zijlstra
1d251b8339
gh-128184: Fix display of signatures with ForwardRefs (#130815)
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-03-04 06:58:37 -08:00
Donghee Na
80e6d3ec49
gh-130547: Fix race between dict_dealloc and split_keys_entry_added (gh-130778) 2025-03-04 22:50:33 +09:00
Petr Viktorin
d91cc9db15
gh-129666: Add C11/C++11 to docs and -pedantic-errors to GCC/clang test_c[pp]ext tests (GH-130692)
Disable pedantic check for c++03 (unlimited API)

Also add a check for c++03 *limited* API, which passes in pedantic mode
after removing a comma in the `PySendResult` declaration, and allowing
`long long`.
2025-03-04 14:10:09 +01:00
Victor Stinner
6c48ed7d62
gh-130736: Fix asyncio test_shutdown_default_executor_timeout() (#130800)
Replace time.sleep() with threading.Event.
2025-03-04 11:16:07 +00:00
Bénédikt Tran
3929af5e3a
gh-89083: add support for UUID version 7 (RFC 9562) (#121119)
Add support for generating UUIDv7 objects according to RFC 9562, §5.7 [1].

The functionality is provided by the `uuid.uuid7()` function. The implementation
is based on a 42-bit counter as described by Method 1, §6.2 [2] and guarantees
monotonicity within the same millisecond.

[1]: https://www.rfc-editor.org/rfc/rfc9562.html#section-5.7
[2]: https://www.rfc-editor.org/rfc/rfc9562.html#section-6.2

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Éric <merwok@netwok.org>
2025-03-04 10:47:19 +01:00
Victor Stinner
0b6e98c841
gh-111178: Fix function signatures in structseq.c (#130683) 2025-03-04 10:33:45 +01:00
Victor Stinner
ed8675c571
gh-111178: Fix function signatures of unicodeiter (#130684) 2025-03-04 10:33:09 +01:00
Bénédikt Tran
15d926b285
gh-130149: fix HMAC tests for some FIPS-only build bots (#130788)
Skips some HMAC tests for some FIPS-only build bots that do not have the underlying hash functions.
2025-03-04 10:15:33 +01:00
Andrii Hrimov
d780f0af2b
gh-130486: Fix test_venv fails from within venv (GH-130487) 2025-03-04 07:48:07 +00:00
Neil Schemenauer
813bc5694b
gh-130599: use static constants str-to-int conversion (gh-130714)
Avoid a data race in free-threaded builds due to mutating global arrays at
runtime.  Instead, compute the constants with an external Python script and
then define them as static global constant arrays.  These constants are
used by `long_from_non_binary_base()`.
2025-03-03 19:00:50 -08:00
Tomas R.
bbf197913c
gh-124445: Allow specializing generic ParamSpec aliases (#124512)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-03-03 14:58:33 -08:00
Sergey Miryanov
3a7f17c7e2
gh-130790: Remove references about unicode's readiness from comments (#130801) 2025-03-03 19:18:09 +00:00
Victor Stinner
8a64a62002
gh-130737: Fix multiprocessing test_notify() (#130797)
Replace hardcoded delay (100 ms) with a loop awaiting until a
condition is true: replace assertReturnsIfImplemented() with
assertReachesEventually().

Use sleeping_retry() in assertReachesEventually() to tolerate slow
buildbots and raise an exception on timeout (30 seconds).
2025-03-03 18:45:26 +00:00
Barney Gale
d0eb01c9de
GH-128520: Merge pathlib._abc into pathlib.types (#130747)
There used to be a meaningful distinction between these modules: `pathlib`
imported `pathlib._abc` but not `pathlib.types`. This is no longer the
case (neither module is imported), so we move the ABCs as follows:

- `pathlib._abc.JoinablePath` --> `pathlib.types._JoinablePath`
- `pathlib._abc.ReadablePath` --> `pathlib.types._ReadablePath`
- `pathlib._abc.WritablePath` --> `pathlib.types._WritablePath`
2025-03-03 17:56:57 +00:00
Tomas R.
321bf59512
gh-130453: pygettext: Allow overriding default keywords when using --keyword (GH-130709) 2025-03-03 18:57:01 +02:00
Yuki Kobayashi
b3c18bfd82
gh-130711: Document PyBaseObject_Type (GH-130712)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-03-03 15:08:05 +01:00