Commit Graph

122907 Commits

Author SHA1 Message Date
Sam Gross a640a605a8
gh-121652: Handle `allocate_weakref` returning NULL (#121653)
The `allocate_weakref` may return NULL when out of memory. We need to
handle that case and propagate the error.
2024-07-13 12:07:52 -04:00
Milan Oberkirch a183474293
gh-121711: Set `-m asyncio` return_code to 1 for ENOTTY (#121714)
Set return_code to 1 for ENOTTY
2024-07-13 17:17:24 +02:00
Gregor 178e44de8f
gh-121657: Display correct error message for yield from outside of a function (GH-121680)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-13 17:14:39 +02:00
Bénédikt Tran f4d6e45c1e
gh-120452: improve documentation about private name mangling (#120451)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-07-13 07:45:18 -07:00
mirelagrigoras 422855ad21
gh-120823: Fix doc for ftplib.FTP.retrbinary() (GH-121697)
Co-authored-by: Mirela Andreea GRIGORAS <magrigoras@bitdefender.com>
2024-07-13 16:16:26 +02:00
Sam Gross abc3aeebdb
gh-121605: Increase timeout in test_pyrepl.run_repl (#121606)
We also need to close the `slave_fd` earlier so that reading from
`master_fd` won't block forever when the subprocess finishes.
2024-07-13 15:54:28 +02:00
Tomas R 0a26aa5007
gh-121671: Increase test coverage of `ast.get_docstring` (GH-121674)
Increase test coverage for `ast.get_docstring`
2024-07-13 14:59:15 +02:00
Timon Viola fc21781175
gh-96765: Update ConfigParser.read() docs with multi-file read example (#121664)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-13 12:47:05 +00:00
Pablo Galindo Salgado 4b9e10d0ea
gh-121499: Fix multi-line history rendering in the REPL (#121531)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2024-07-13 12:54:10 +02:00
Marta Gómez Macías e745996b2d
gh-121609: Fix pasting of characters containing unicode character joiner (#121667) 2024-07-13 10:44:18 +00:00
Serhiy Storchaka 18015451d0
gh-121153: Fix some errors with use of _PyLong_CompactValue() (GH-121154)
* The result has type Py_ssize_t, not intptr_t.
* Type cast between unsigned and signdet integer types should be explicit.
* Downcasting should be explicit.
* Fix integer overflow check in sum().
2024-07-13 13:40:44 +03:00
Bas Bloemsaat 0759cecd9d
gh-99242 Ignore error when running regression tests under certain conditions. (GH-121663)
Co-Authored-By: Kevin Diem <kg.diem@gmail.com>
2024-07-13 11:52:08 +02:00
Pablo Galindo Salgado 4e36dd7d87
gh-121497: Make Pyrepl respect correctly the history with input hook set (#121498) 2024-07-13 09:42:14 +00:00
Zachary Ware dc03ce797a
gh-95144: Improve error message of `... in None` (GH-119888) 2024-07-12 16:34:17 +00:00
Savannah Ostrowski 65fededf9c
Update retroactive comments from GH-117741 (segfault in `FutureIter_dealloc`) (GH-121638)
Address comments
2024-07-12 10:34:30 +02:00
Sam Gross e8c91d90ba
gh-121103: Put free-threaded libraries in `lib/python3.14t` (#121293)
On POSIX systems, excluding macOS framework installs, the lib directory
for the free-threaded build now includes a "t" suffix to avoid conflicts
with a co-located default build installation.
2024-07-11 16:21:37 -04:00
Eric Snow 5250a03133
gh-117482: Fix Builtin Types Slot Wrappers (gh-121602)
When builtin static types are initialized for a subinterpreter, various "tp" slots have already been inherited (for the main interpreter).  This was interfering with the logic in add_operators() (in Objects/typeobject.c), causing a wrapper to get created when it shouldn't.  This change fixes that by preserving the original data from the static type struct and checking that.
2024-07-11 20:20:14 +00:00
Jelle Zijlstra 58e8cf2bb6
gh-121332: Make AST node constructor check _attributes instead of hardcoding attributes (#121334) 2024-07-11 14:34:53 +00:00
Sam Gross 44937d11a6
gh-121592: Make select.poll() and related objects thread-safe (#121594)
This makes select.poll() and kqueue() objects thread-safe in the
free-threaded build. Note that calling close() concurrently with other
functions is still not thread-safe due to races on file descriptors
(gh-121544).
2024-07-11 10:21:09 -04:00
sobolevn e6264b44dc
gh-121615: Improve `module.rst` C-API docs with better error descriptions (#121616) 2024-07-11 11:57:22 +03:00
Tian Gao 690b9355e0
gh-121450: Make inline breakpoints use the most recent pdb instance (#121451) 2024-07-10 19:54:27 -07:00
Irit Katriel 6557af6698
gh-121554: remove unnecessary internal functions in compile.c (#121555)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-07-10 23:48:37 +01:00
Irit Katriel ef10110cd7
gh-119786: fix broken links in docs and comment (#121601) 2024-07-10 21:59:14 +00:00
Eric Snow 35a67e36aa
gh-121596: Fix Sharing Interpreter Channels (gh-121597)
This fixes a mistake in gh-113012 and adds a test that verifies the fix.
2024-07-10 21:31:09 +00:00
Sam Gross 7641743d48
gh-117657: Remove TSAN suppressions for _abc.c (#121508)
The functions look thread-safe and I haven't seen any warnings issued
when running the tests locally.
2024-07-10 17:08:10 -04:00
Sam Gross 3ec719fabf
gh-117657: Fix TSan race in _PyDict_CheckConsistency (#121551)
The only remaining race in dictobject.c was in _PyDict_CheckConsistency
when the dictionary has shared keys.
2024-07-10 14:04:12 -04:00
Ken Jin 3bfc9c831a
gh-120198: Stop the world when setting __class__ on free-threaded build (GH-120672) 2024-07-11 02:02:08 +08:00
Stefano Rivera a802277914
gh-121460: Skip freeing unallocated arenas (gh-121491)
`munmap(NULL)` is not noop, like `free(NULL)` is.

Fixes an observed testsuite hang on 32-bit ARM systems.
2024-07-10 10:40:55 -06:00
Irit Katriel 0177a34335
gh-121404: remove some accesses to compiler internals from codegen functions (#121538) 2024-07-10 17:09:45 +01:00
Sam Gross af9f6de6ea
gh-107851: Fix spurious failures in fcntl eintr tests (#121556)
On heavily loaded machines, the subprocess may finish its sleep before
the parent process manages to synchronize with it via a failed lock.

This leads to errors like:

  Exception: failed to sync child in 300.3 sec

Use pipes instead to mutually synchronize between parent and child.
2024-07-10 10:36:52 -04:00
Victor Stinner ca0fb3423c
gh-89364: Export PySignal_SetWakeupFd() function (#121537)
Export the PySignal_SetWakeupFd() function. Previously, the function
was documented but it couldn't be used in 3rd party code.
2024-07-10 15:47:08 +02:00
sobolevn 84a5597b08
gh-121567: Improve `slice` C-API docs by mentioning exceptions (#121568)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-07-10 13:56:44 +03:00
Irit Katriel cced22c760
gh-121547: deduplicate the code of const_cache update functions (#121548) 2024-07-10 10:34:54 +00:00
sobolevn e2822360da
gh-121571: Do not use `EnvironmentError` in tests, use `OSError` instead (#121572) 2024-07-10 13:11:46 +03:00
Serhiy Storchaka 22a0bdbf9a
Improve zipimport tests (GH-121535) 2024-07-10 11:29:03 +03:00
satori1995 9585a1a2a2
GH-121439: Allow PyTupleObjects with an ob_size of 20 in the free_list to be reused (gh-121428) 2024-07-10 07:48:25 +00:00
Brett Cannon f62161837e
GH-121521: Detect when wasmtime is not installed in `Tools/wasm/wasi.py` (GH-121522) 2024-07-09 15:08:01 -07:00
Brett Cannon 8020946814
GH-120372: Switch to wasmtime 22 (GH-121523)
Along the way, make the cache key in GitHub Actions for `config.cache` be more robust in the face of potential env var changes from `Tools/wasm/wasi.py`.
2024-07-09 15:02:25 -07:00
Sam Gross 04397434aa
gh-117657: Skip test when running under TSan (GH-121549)
The ProcessPoolForkserver combined with resource_tracker starts a thread
after forking, which is not supported by TSan.

Also skip test_multiprocessing_fork for the same reason
2024-07-09 14:12:45 -07:00
Sam Gross 9c08f40a61
gh-117657: Fix TSAN races in setobject.c (#121511)
The `used` field must be written using atomic stores because `set_len`
and iterators may access the field concurrently without holding the
per-object lock.
2024-07-09 12:11:43 -04:00
sobolevn 649d5b6d7b
gh-121533: Improve `PyCell_[Get,Set]` docs: mention the exceptions (#121534)
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-09 18:47:35 +03:00
Rafael Fontenelle 9ba2a4638d
Docs: fix typo and duplicate word in configure.rst (#121410) 2024-07-09 14:24:37 +02:00
Mark Shannon bf8686e1ea
GH-118926: Better distinguish between pointer and arrays in interpreter generator (GH-121496) 2024-07-09 11:33:56 +01:00
AN Long facf9862da
gh-121333: Clarify what is the default executor for asyncio.run_in_executor (#121335)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-07-09 14:52:07 +05:30
Eric Snow 15d48aea02
gh-121110: Fix Extension Module Tests Under Py_TRACE_REFS Builds (gh-121503)
The change in gh-118157 (b2cd54a) should have also updated clear_singlephase_extension() but didn't.  We fix that here.  Note that clear_singlephase_extension() (AKA _PyImport_ClearExtension()) is only used in tests.
2024-07-08 15:10:00 -06:00
Sam Gross 218edaf0ff
gh-121018: Fix typo in NEWS entry (#121510) 2024-07-08 16:44:56 -04:00
Hugo van Kemenade 006b53a42f
NEWS: Fix Sphinx warnings and increase threshold for new news nits (#121482)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-07-08 14:30:05 -06:00
Irit Katriel 2be37ec8e2
gh-121404: remove direct accesses to u_private from codegen functions (#121500) 2024-07-08 21:02:01 +01:00
Sam Gross 1d3cf79a50
gh-121368: Fix seq lock memory ordering in _PyType_Lookup (#121388)
The `_PySeqLock_EndRead` function needs an acquire fence to ensure that
the load of the sequence happens after any loads within the read side
critical section. The missing fence can trigger bugs on macOS arm64.

Additionally, we need a release fence in `_PySeqLock_LockWrite` to
ensure that the sequence update is visible before any modifications to
the cache entry.
2024-07-08 14:52:07 -04:00
Marc Mueller 31873bea47
gh-121487: Fix deprecation warning for ATOMIC_VAR_INIT in mimalloc (gh-121488) 2024-07-08 14:32:30 -04:00