125626 Commits

Author SHA1 Message Date
Kanishk Pachauri
0ff1611574
gh-130160: use .. program:: directive for documenting idle CLI (#130278)
---------
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-02-24 02:02:34 +00:00
Andrew Shteren
cd6abe27a2
gh-128641: Fix ConfigParser.read Perfomance Regression (#129596)
---------

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-02-24 00:20:37 +00:00
Bénédikt Tran
071820113f
gh-130151: Fix reference leaks in _hashlib.hmac_{new,digest} (GH-130152)
* fix leak in `_hashlib.hmac_new`
* fix leak in `hmac_digest`
* fix exception type in `_hashlib.HMAC.copy`
2025-02-24 00:09:14 +00:00
Łukasz Langa
72ea3c030a
gh-128627: Skip wasm-gc on iOS Safari where it's broken (#130418)
As of iOS 18.3.1, enabling wasm-gc breaks the interpreter. This disables the wasm-gc
trampoline on iOS.

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2025-02-24 07:26:04 +08:00
donBarbos
81a9b53fee
gh-107773: Make datetime subclass repr consistent both implementations (#130308)
---------

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2025-02-23 16:29:31 -05:00
mingyu
9f81f828c7
gh-129948: Add set() to multiprocessing.managers.SyncManager (#129949)
The SyncManager provided support for various data structures such as dict, list, and queue, but oddly, not set.
This introduces support for set by defining SetProxy and registering it with SyncManager.

---
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-02-23 20:07:33 +00:00
Y5
a65366ed87
gh-124096: Enable REPL virtual terminal support on Windows (#124119)
To support virtual terminal mode in Windows PYREPL, we need a scanner
to read over the supported escaped VT sequences.

Windows REPL input was using virtual key mode, which does not support
terminal escape sequences. This patch calls `SetConsoleMode` properly
when initializing and send sequences to enable bracketed-paste modes
to support verbatim copy-and-paste.

Signed-off-by: y5c4l3 <y5c4l3@proton.me>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Dustin L. Howett <dustin@howett.net>
Co-authored-by: wheeheee <104880306+wheeheee@users.noreply.github.com>
2025-02-23 20:30:33 +01:00
Jacob Austin Lincoln
25a7ddf2ef
gh-65697: Prevent configparser from writing keys it cannot properly read (#129270)
---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2025-02-23 11:06:33 -05:00
Bénédikt Tran
1e4a4344af
gh-111178: fix UBSan failures in Modules/_struct.c (#129793)
Fix some UBSan failures for `PyStructObject` and `unpackiterobject`.

We also perform some cleanup by suppressing unused return values and renaming the
unused parameter in `METH_NOARGS` and getter methods to `dummy` and `closure`
respectively for semantic purposes.
2025-02-23 10:34:11 +00:00
Bénédikt Tran
b8c313a41c
gh-84559: improve What's New entry for multiprocessing start method changes (#128173)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-02-23 10:35:08 +01:00
sobolevn
5ec4bf86b7
gh-121970: Replace .. coroutine{method,function} with :async: (#130448)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-02-22 17:54:43 +00:00
Adam Turner
3cc9e867eb
Docs: Test presence of optional extensions with importlib (#130445) 2025-02-22 17:52:47 +00:00
Daraan
d8ce092fe4
Add test checking value of a TypedDict's __total__ attribute when there is an assignment in the class body. (#130460)
In relation to #109544 which changed this behavior.

Signed-off-by: Daniel Sperber <github.blurry@9ox.net>
2025-02-22 09:34:22 -08:00
sobolevn
89d8b2d14b
Add measuring unit to sys.getswitchinterval docs (#130457) 2025-02-22 19:05:10 +03:00
Chris Eibl
65b339c5ca
gh-111178: fix clang-cl compilation of Modules/mmapmodule.c post gh-129784 (#130446)
The `PyCFunction` cast on `mmap__sizeof__method` was removed but the method was not updated accordingly.
2025-02-22 12:36:38 +01:00
Russell Keith-Magee
474c388740
gh-129712: Document the wheels tags corresponding to each universal SDK. (#130389)
Document the architectures supported by macOS universal SDK configuration flags, 
and add details on wheel tag naming.
2025-02-22 16:30:30 +08:00
Adam Turner
30e892473e
GH-121970: Replace custom abstract method directive with the `:abstract:` option (#129311) 2025-02-22 01:53:57 +00:00
Adam Turner
8e96adf453
gh-130159: Fix list indentation in collections.abc (#130165) 2025-02-22 01:41:15 +00:00
Yan Yanchii
38642bff13
gh-126835: Move constant unaryop & binop folding to CFG (#129550) 2025-02-21 17:54:22 +00:00
Barney Gale
d88677ac20
GH-128520: More consistent type-checking behaviour in pathlib (#130199)
In the following methods, skip casting of the argument to a path object if
the argument has a `with_segments` attribute. In `PurePath`:
`relative_to()`, `is_relative_to()`, `match()`, and `full_match()`. In
`Path`: `rename()`, `replace()`, `copy()`, `copy_into()`, `move()`, and
`move_into()`.

Previously the check varied a bit from method to method. The `PurePath`
methods used `isinstance(arg, PurePath)`; the `rename()` and `replace()`
methods always cast, and the remaining `Path` methods checked for a private
`_copy_writer` attribute.

We apply identical changes to relevant methods of the private ABCs. This
improves performance a bit, because `isinstance()` checks on ABCs are
expensive.
2025-02-21 17:47:45 +00:00
Raymond Hettinger
286c517db0
gh-130285: Fix handling of zero or empty counts in random.sample() (gh-130291) 2025-02-21 11:33:10 -06:00
Pieter Eendebak
0c4248f88e
gh-126332: Add tests for _pyrepl.utils (#129325) 2025-02-21 16:10:13 +00:00
Hugo van Kemenade
1cf9b6d9b8
gh-129965: Add missing MIME types (#129969)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-02-21 15:44:53 +00:00
Adam Turner
d0a1e5c222
GH-103180: Set a timeout for every job in GitHub Actions (#130375) 2025-02-21 17:11:26 +02:00
Bénédikt Tran
2922429538
gh-111178: fix UBSan failures in Modules/_randommodule.c (GH-129791)
Fix UBSan failures for `RandomObject`
Suppress unused return values
2025-02-21 14:59:04 +00:00
Bénédikt Tran
55f8bac208
gh-111178: fix UBSan failures in Modules/_queuemodule.c (GH-129790)
Fix UBSan failures for `simplequeueobject`

Suppress unused return values
2025-02-21 14:37:32 +00:00
Bénédikt Tran
4f07fd59cb
gh-111178: fix UBSan failures in Modules/_functoolsmodule.c (GH-129778)
Fix UBSan failures for `keyobject`, `lru_list_elem`, `lru_cache_object`.
Suppress unused return values.
Change `_PyPartialObject_CAST` (from #124733) to `partialobject_CAST`
for consistency with the current style for these macros
2025-02-21 15:08:56 +01:00
Victor Stinner
f1b81c408f
gh-129363: Change regrtest sequential mode output (#129476)
First, write the test name without color. Then, write the test name
and the result with color. Each test is displayed twice.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-02-21 14:55:32 +01:00
Hizuru
c359fcd2f5
gh-129569: The function unicodedata.normalize() always returns built-in str (#129570)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-02-21 14:51:13 +01:00
sobolevn
9bf73c032f
Add .. versionadded directive to dis CLI options (#130267) 2025-02-21 15:59:17 +03:00
UV
5d66c55c8a
gh-127805: Clarify Formatter initialization in logging.rst. (GH-127850) 2025-02-21 07:10:04 +00:00
Redddy
d63af9540f
Fix outdated reference link in collections module (gh-130349) 2025-02-20 23:58:58 +00:00
Dino Viehland
6c450f44c2
gh-130313: Avoid locking when clearing objects (#130126)
Avoid locking when clearing objects in the free-threaded build
2025-02-20 13:32:57 -08:00
Sergey Miryanov
69426fcee7
gh-130052: Fix some exceptions on error paths in _testexternalinspection (#130053)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-02-20 17:05:39 +00:00
Sam Gross
ca22147547
gh-111924: Fix data races when swapping allocators (gh-130287)
CPython current temporarily changes `PYMEM_DOMAIN_RAW` to the default
allocator during initialization and shutdown. The motivation is to
ensure that core runtime structures are allocated and freed using the
same allocator. However, modifying the current allocator changes global
state and is not thread-safe even with the GIL. Other threads may be
allocating or freeing objects use PYMEM_DOMAIN_RAW; they are not
required to hold the GIL to call PyMem_RawMalloc/PyMem_RawFree.

This adds new internal-only functions like `_PyMem_DefaultRawMalloc`
that aren't affected by calls to `PyMem_SetAllocator()`, so they're
appropriate for Python runtime initialization and finalization. Use
these calls in places where we previously swapped to the default raw
allocator.
2025-02-20 11:31:15 -05:00
Collin Funk
568db400ff
gh-129838: Don't redefine _Py_NO_SANITIZE_UNDEFINED (#129839)
Newer GCC versions accept both __attribute__((no_sanitize("undefined")))
and __attribute__((no_sanitize_undefined)) so check that the macro is
not already defined.
2025-02-20 17:02:33 +01:00
Marc Mueller
0f5b82169e
gh-46236: Document PyUnicode_RSplit, PyUnicode_Partition and PyUnicode_RPartition (#130191)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-02-20 16:41:41 +01:00
Sam Gross
35925e9529
gh-129269: Exclude everything in sys.path in test_coverage_ignore (gh-130133)
The `test_trace.test_coverage_ignore` test would fail if you had
`setuptools` installed, such as in `~/.local/lib/python3.xxx/site-packages/`.
Ignore everything in `sys.path` when running the test.
2025-02-20 10:13:44 -05:00
Vinay Sajip
8cbcf51d61
[doc]: Update logging cookbook to mention domain socket configuration in a recipe. (GH-130348) 2025-02-20 14:09:15 +00:00
Bénédikt Tran
5a13faa1b7
gh-111178: fix UBSan failures in Modules/_pickle.c (#129787)
Fix UBSan failures for `Pdata`, `PicklerObject`, `UnpicklerObject`, `PicklerMemoProxyObject`, `UnpicklerMemoProxyObject`

Indicate safe fast cast to avoid redundant future checks

Use semantically correct parameter names
2025-02-20 14:27:35 +01:00
Bénédikt Tran
deac31d214
gh-111178: fix UBSan failures in Modules/overlapped.c (GH-129786)
Fix UBSan failures for `OverlappedObject`
2025-02-20 14:24:24 +01:00
Bénédikt Tran
4466e91360
gh-111178: fix UBSan failures in Modules/_operator.c (GH-129785)
Fix UBSan failures for `itemgetterobject`, `attrgetterobject`, `methodcallerobject`

Suppress unused return values
2025-02-20 14:21:55 +01:00
Bénédikt Tran
e24a1ac17c
gh-129173: Use _PyUnicodeError_GetParams in PyCodec_SurrogateEscapeErrors (GH-129175) 2025-02-20 13:18:47 +00:00
Victor Stinner
519c2c6740
gh-128863: Deprecate the private _PyUnicodeWriter API (#129245)
Deprecate private C API functions:

* _PyUnicodeWriter_Init()
* _PyUnicodeWriter_Finish()
* _PyUnicodeWriter_Dealloc()
* _PyUnicodeWriter_WriteChar()
* _PyUnicodeWriter_WriteStr()
* _PyUnicodeWriter_WriteSubstring()
* _PyUnicodeWriter_WriteASCIIString()
* _PyUnicodeWriter_WriteLatin1String()

These functions are not deprecated in the internal C API (if the
Py_BUILD_CORE macro is defined).
2025-02-20 14:02:02 +01:00
Yuki Kobayashi
3bda821a83
gh-101100: Fix sphinx warnings in readline.rst (#130300) 2025-02-20 14:56:27 +02:00
Irit Katriel
048ee2d5ec
gh-130250: use support.swap_attr() in test and don't assume we're beginning with a clean system state (#130342) 2025-02-20 11:29:18 +00:00
Alcaro
417372bd43
Fix some ctypes docs typos (GH-130307) 2025-02-20 11:58:50 +01:00
Serhiy Storchaka
10b32054ad
gh-127750: Restore inspect and pydoc support of singledispatchmethod (GH-130309)
The code is still flawed, because it does not recognize class and static
methods, and the first argument is not removed from the signature of
bound methods, but at least it does not worse than in 3.13 and older.
2025-02-20 11:08:49 +02:00
Stan Ulbrych
ed831b95a2
gh-69001: Convert links to more usable buttons (#129591)
In Lib/idlelib/help_about.py, there are 2 links that are not underlined or colored, hence hard to tell that clicking works.  All buttons might get converted to colored and underlined links in the future.
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-02-20 08:30:57 +00:00
Sabfo
47ace53995
gh-130130: Clarify hash=False docs in dataclasses.field (#130324) 2025-02-20 02:43:27 -05:00