Commit graph

125638 commits

Author SHA1 Message Date
Kumar Aditya
38d45d23a6
gh-129874: avoid mixing pure python and C impl in eager execution (#130515) 2025-02-24 15:37:59 +00:00
Russell Keith-Magee
8a76eb8469
gh-130384: Skip a test_getallocatedblocks test pre-condition on iOS. (GH-130385) 2025-02-24 15:34:38 +00:00
Bartosz Sławecki
7ed3dc6392
gh-128231: Use runcode() return value for failing early (GH-129488) 2025-02-24 15:50:13 +01:00
RUANG (James Roy)
9f25c1f012
gh-46236: Add docs for PyUnicode_GetDefaultEncoding() doc (GH-130335)
* Clarify sys.getdefaultencoding() documentation

* Add missing documentation for PyUnicode_GetDefaultEncoding,
  the C equivalent of sys.getdefaultencoding
2025-02-24 15:37:21 +01:00
Petr Viktorin
fc8d2cba54
gh-129405: Fix doc for Py_mod_multiple_interpreters default, and add test (GH-129406) 2025-02-24 14:59:19 +01:00
Bénédikt Tran
805839021b
gh-111178: fix UBSan failures in Modules/_winapi.c (GH-129796)
Fix UBSan failures for `OverlappedObject`

Suppress unused return values
2025-02-24 14:06:13 +01:00
Bénédikt Tran
39ba4b6619
gh-127522: wsgiref: indicate that start_response objects should follow a specific protocol (GH-127525) 2025-02-24 13:43:56 +01:00
Bénédikt Tran
f8eefc2f35
gh-111178: fix UBSan failures in Modules/_threadmodule.c (GH-129794)
Fix UBSan failures for `PyThreadHandleObject`, `lockobject`, `rlockobject`, `localdummyobject`, `localobject`

Add safe casts

Clean up module functions

Use semantically correct parameter names
2025-02-24 13:42:39 +01:00
Bénédikt Tran
73bbaf33ae
gh-111178: fix UBSan failures in Modules/selectmodule.c (GH-129792)
Fix some UBSan failures for `pollObject`, `devpollObject`, `pyEpoll_Object` as well as
for `kqueue_event_Object`, `kqueue_queue_Object` and `kqueue_tracking_after_fork`.

Suppress unused return values.

Rename the unused parameter in `METH_NOARGS` and getter/setter methods to
`dummy` and `closure` respectively for semantic purposes.

Explicitly declare `_select_exec` as a `static` function.
2025-02-24 13:38:18 +01:00
Bénédikt Tran
de13293d26
gh-111178: fix UBSan failures in Modules/posixmodule.c (GH-129788)
Fix UBSan failures for `DirEntry`, `ScandirIterator`
Use better semantic naming
2025-02-24 13:20:49 +01:00
Bénédikt Tran
c070abadb2
gh-111178: fix UBSan failures in Modules/pyexpat.c (GH-129789)
Fix UBSan failures for `xmlparseobject`, XML handler setters
Suppress unused return values

Rewrite `RC_HANDLER` with better semantics
2025-02-24 11:56:32 +01:00
Petr Viktorin
ef29104f7d
GH-91079: Revert "GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)" for now (GH130413)
Revert "GH-91079: Implement C stack limits using addresses, not counters. (GH-130007)" for now

Unfortunatlely, the change broke some buildbots.

This reverts commit 2498c22fa0.
2025-02-24 11:16:08 +01:00
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