summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-127314: Don't mention the GIL when calling without a thread state on the ↵Peter Bierma2024-12-065-7/+36
| | | | | free-threaded build (#127315) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-125610: Fix `STORE_ATTR_INSTANCE_VALUE` specialization check (GH-125612)Sam Gross2024-12-061-1/+4
| | | | The `STORE_ATTR_INSTANCE_VALUE` opcode doesn't support objects with non-NULL managed dictionaries, so don't specialize to that op in that case.
* gh-126024: fix UBSan failure in `unicodeobject.c:find_first_nonascii` ↵Bénédikt Tran2024-12-061-6/+3
| | | | (GH-127566)
* gh-101100: amend references starting with `!~` in gh-127054 (#127684)Yuki Kobayashi2024-12-061-5/+5
|
* GH-126491: Lower heap size limit with faster marking (GH-127519)Mark Shannon2024-12-066-243/+208
| | | | | | | * Faster marking of reachable objects * Changes calculation of work to do and work done. * Merges transitive closure calculations
* gh-120010: Fix invalid (nan+nanj) results in _Py_c_prod() (GH-120287)Sergey B Kirpichev2024-12-063-4/+75
| | | | | | | | | | | | | | | | | | | | In some cases, previously computed as (nan+nanj), we could recover meaningful component values in the result, see e.g. the C11, Annex G.5.1, routine _Cmultd(): >>> z = 1e300+1j >>> z*(nan+infj) # was (nan+nanj) (-inf+infj) That also fix some complex powers for small integer exponents, computed with optimized algorithm (by squaring): >>> z**5 # was (nan+nanj) Traceback (most recent call last): File "<python-input-1>", line 1, in <module> z**5 ~^^~ OverflowError: complex exponentiation
* gh-127655: Ensure `_SelectorSocketTransport.writelines` pauses the protocol ↵J. Nick Koston2024-12-063-0/+14
| | | | | | | if needed (#127656) Ensure `_SelectorSocketTransport.writelines` pauses the protocol if it reaches the high water mark as needed. Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-127627: Add `posix._emscripten_debugger` function (#127628)Hood Chatham2024-12-063-2/+50
| | | Add a posix._emscripten_debugger function to add an emscripten breakpoint.
* GH-125413: Revert addition of `pathlib.Path.scandir()` method (#127377)Barney Gale2024-12-057-85/+22
| | | | | | | | | | Remove documentation for `pathlib.Path.scandir()`, and rename the method to `_scandir()`. In the private pathlib ABCs, make `iterdir()` abstract and call it from `_scandir()`. It's not worthwhile to add this method at the moment - see discussion: https://discuss.python.org/t/ergonomics-of-new-pathlib-path-scandir/71721 Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* gh-127582: Make object resurrection thread-safe for free threading. (GH-127612)Sam Gross2024-12-056-20/+87
| | | | | | | | | | | | Objects may be temporarily "resurrected" in destructors when calling finalizers or watcher callbacks. We previously undid the resurrection by decrementing the reference count using `Py_SET_REFCNT`. This was not thread-safe because other threads might be accessing the object (modifying its reference count) if it was exposed by the finalizer, watcher callback, or temporarily accessed by a racy dictionary or list access. This adds internal-only thread-safe functions for temporary object resurrection during destructors.
* [Docs] GDB howto: Fix block type of a cast example (#127621)Maciej Olko2024-12-051-1/+1
|
* gh-127221: Add colour to unittest output (#127223)Hugo van Kemenade2024-12-0515-60/+136
| | | Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* GH-126727: Fix test_era_nl_langinfo with Japanese ERAs on Solaris (GH-127327)Jakub Kulík2024-12-051-0/+5
| | | Fix test_era_nl_langinfo with Japanese ERAs on Solaris
* gh-122431: Disallow negative values in `readline.append_history_file` (#122469)Peter Bierma2024-12-053-0/+15
| | | Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-127413: allow to show specialized bytecode via `dis` CLI (#127414)Bénédikt Tran2024-12-054-2/+19
|
* gh-93312: Include <sys/pidfd.h> to get PIDFD_NONBLOCK (#127593)Victor Stinner2024-12-055-1/+15
|
* gh-119182: Complete PyUnicodeWriter documentation (#127607)Victor Stinner2024-12-051-0/+9
|
* gh-127434: Fix iOS `xcrun --sdk` clang/ar scripts to allow arguments with ↵Feodor Fitsner2024-12-0513-12/+13
| | | | | spaces (#127575) Added shell escaping to ensure iOS compiler shims can accept arguments with spaces.
* gh-127503: Emscripten make Python.sh function as proper Python CLI (#127506)Hood Chatham2024-12-054-17/+51
| | | Modifies the python.sh script to work on macOS, and adapt to recent emscripten changes.
* gh-127146: Emscripten: Skip segfaults in test suite (#127151)Hood Chatham2024-12-0521-8/+46
| | | | Added skips for tests known to cause problems when running on Emscripten. These mostly relate to the limited stack depth on Emscripten.
* gh-127111: Apply prettier formatter to Emscripten web example (#127551)Hood Chatham2024-12-052-446/+511
| | | Cleaned up formatting (and a stray closing tag) of the web example HTML and JS.
* GH-126795: Increase the JIT side-exit threshold from 64 to 4096 (GH-127155)Brandt Bucher2024-12-041-4/+3
|
* Enable native AArch64 Ubuntu CI jobs (#127584)Diego Russo2024-12-044-117/+24
| | | Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* gh-127536: Add missing locks in listobject.c (GH-127580)Sam Gross2024-12-042-10/+42
| | | | We were missing locks around some list operations in the free threading build.
* gh-127552: Remove comment questioning 4-digit restriction for ‘Y’ in ↵Beomsoo Kim2024-12-041-2/+0
| | | | | datetime.strptime patterns (#127590) The code has required 4 digits for the year since its inclusion in the stdlib in 2002 (over 22 years ago as of this commit).
* gh-127481: Add `EPOLLWAKEUP` to the `select` module (GH-127482)RUANG (James Roy)2024-12-043-0/+11
|
* gh-123378: Ensure results of `PyUnicode*Error_Get{Start,End}` are clamped ↵Bénédikt Tran2024-12-047-111/+492
| | | | | | (GH-123380) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* gh-126524: Run `regen-unicodedata` as a part of our CI (#126682)sobolevn2024-12-041-1/+1
|
* gh-127572: Fix `test_structmembers` initialization (GH-127577)Sam Gross2024-12-042-2/+2
| | | | | | | | gh-127572: Fix `test_structmembers` initialization. The 'C' format code expects an `int` as a destination (not a `char`). This led to test failures on big-endian platforms like s390x. Use the 'c' format code, which expects a `char` as the destination (but requires a Python byte objects instead of a str).
* Itertool recipe additions (gh-127483)Raymond Hettinger2024-12-041-0/+37
|
* gh-127146: Resolve some minor problems in Emscripten tests (#127565)Hood Chatham2024-12-043-4/+4
| | | | Adjusts some Emscripten test exclusions regarding strftime, fma, and stack depth.
* gh-112192: Increase the trace module coverage precision to one decimal (#126972)RUANG (James Roy)2024-12-034-7/+7
|
* gh-115999: Enable specialization of `CALL` instructions in free-threaded ↵mpage2024-12-0311-92/+220
| | | | | | | | | | | | | | | | | | | | | | builds (#127123) The CALL family of instructions were mostly thread-safe already and only required a small number of changes, which are documented below. A few changes were needed to make CALL_ALLOC_AND_ENTER_INIT thread-safe: Added _PyType_LookupRefAndVersion, which returns the type version corresponding to the returned ref. Added _PyType_CacheInitForSpecialization, which takes an init method and the corresponding type version and only populates the specialization cache if the current type version matches the supplied version. This prevents potentially caching a stale value in free-threaded builds if we race with an update to __init__. Only cache __init__ functions that are deferred in free-threaded builds. This ensures that the reference to __init__ that is stored in the specialization cache is valid if the type version guard in _CHECK_AND_ALLOCATE_OBJECT passes. Fix a bug in _CREATE_INIT_FRAME where the frame is pushed to the stack on failure. A few other miscellaneous changes were also needed: Use {LOCK,UNLOCK}_OBJECT in LIST_APPEND. This ensures that the list's per-object lock is held while we are appending to it. Add missing co_tlbc for _Py_InitCleanup. Stop/start the world around setting the eval frame hook. This allows us to read interp->eval_frame non-atomically and preserves the behavior of _CHECK_PEP_523 documented below.
* gh-127271: Replace use of PyCell_GET/SET (gh-127272)Neil Schemenauer2024-12-038-48/+231
| | | | | | | | | | | | | | | | | | * Replace uses of `PyCell_GET` and `PyCell_SET`. These macros are not safe to use in the free-threaded build. Use `PyCell_GetRef()` and `PyCell_SetTakeRef()` instead. * Since `PyCell_GetRef()` returns a strong rather than borrowed ref, some code restructuring was required, e.g. `frame_get_var()` returns a strong ref now. * Add critical sections to `PyCell_GET` and `PyCell_SET`. * Move critical_section.h earlier in the Python.h file. * Add `PyCell_GET` to the free-threading howto table of APIs that return borrowed refs. * Add additional unit tests for free-threading.
* gh-115999: Add free-threaded specialization for `SEND` (gh-127426)Neil Schemenauer2024-12-034-15/+50
| | | | | No additional thread safety changes are required. Note that sending to a generator that is shared between threads is currently not safe in the free-threaded build.
* gh-127421: Fix race in test_start_new_thread_failed (#127549)mpage2024-12-031-1/+2
| | | | | | | | | | | | | | Fix race in test_start_new_thread_failed When we succeed in starting a new thread, for example if setrlimit was ineffective, we must wait for the newly spawned thread to exit. Otherwise, we run the risk that the newly spawned thread will race with runtime finalization and access memory that has already been clobbered/freed. `_thread.start_new_thread()` only spawns daemon threads, which the runtime does not wait for at shutdown, and does not return a handle. Use `_thread.start_joinable_thread()` and join the resulting handle when the thread is started successfully.
* gh-115999: Specialize `LOAD_SUPER_ATTR` in free-threaded builds (gh-127128)Neil Schemenauer2024-12-036-21/+51
| | | | | | Use existing helpers to atomically modify the bytecode. Add unit tests to ensure specializing is happening as expected. Add test_specialize.py that can be used with ThreadSanitizer to detect data races. Fix thread safety issue with cell_set_contents().
* gh-127347: Document `traceback.print_list` (#127348)Tomas R.2024-12-034-3/+10
| | | Previously, `traceback.print_list` didn't have a documentation entry and was not exposed in `traceback.__all__`. Now it has a documentation entry and is exposed in `__all__`.
* gh-127255: Make `CopyComPointer` public and add to `ctypes` doc. (GH-127275)Jun Komoda2024-12-035-4/+26
|
* gh-117657: TSAN Fix races in `PyMember_Get` and `PyMember_Set` for C ↵Daniele Parmeggiani2024-12-0310-50/+735
| | | | extensions (GH-123211)
* gh-126585: Add EHWPOISON error code (#126586)RUANG (James Roy)2024-12-034-0/+16
|
* gh-127253: Note that Stable ABI is about ABI stability (GH-127254)Petr Viktorin2024-12-031-3/+11
|
* docs(logging): fix phrasing from "operation on" to "operate on" (#127543)Alexander Stepchenko2024-12-031-1/+1
|
* Speed-up lazy heapq import in collections (gh-127538)Raymond Hettinger2024-12-031-1/+6
|
* gh-127111: Emscripten Make web example work again (#127113)Hood Chatham2024-12-029-92/+175
| | | | | Moves the Emscripten web example into a standalone folder, and updates Makefile targets to build the web example. Instructions for usage have also been added.
* gh-127518: Fix pystats build after #127169 (#127526)Michael Droettboom2024-12-021-2/+3
| | | gh-127518: Fix pystats build after #127619
* gh-127521: Mark list as "shared" before resizing if necessary (#127524)Sam Gross2024-12-021-0/+20
| | | | | | | | | In the free threading build, if a non-owning thread resizes a list, it must use QSBR to free the old list array because there may be a concurrent access (without a lock) from the owning thread. To match the pattern in dictobject.c, we just mark the list as "shared" before resizing if it's from a non-owning thread and not already marked as shared.
* gh-127411: Fix invalid conversion of load of TLBC array when compiled in C++ ↵mpage2024-12-022-2/+9
| | | | | (#127466) Cast the result of the load to the correct type
* gh-126876: Fix test_socket.testLargeTimeout() for missing _testcapi (#127517)Victor Stinner2024-12-021-2/+8
|
* gh-115999: Use light-weight lock for UNPACK_SEQUENCE_LIST (gh-127514)Donghee Na2024-12-025-44/+14
|