Commit Graph

128904 Commits

Author SHA1 Message Date
Cody Maloney
0f0a362768 gh-140607: Validate returned byte count in RawIOBase.read (#140611)
While `RawIOBase.readinto` should return a count of bytes between 0 and
the length of the given buffer, it is not required to. Add validation
inside RawIOBase.read() that the returned byte count is valid.

Co-authored-by: Shamil <ashm.tech@proton.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-10-27 18:06:46 +00:00
Victor Stinner
313145eab5 gh-125434: Display thread name in faulthandler on Windows (#140675) 2025-10-27 18:41:18 +01:00
alm
1753ccb432 gh-138050: [WIP] JIT - Streamline MAKE_WARM - move coldness check to executor creation (GH-138240) 2025-10-27 16:37:37 +00:00
Stan Ulbrych
e03d8e4f50 gh-79922: Remove always false test skips in test_time (#136202) 2025-10-27 15:09:25 +00:00
Alper
9479a62a51 gh-116738: Use PyMutex for bz2 module (gh-140555)
The methods are already wrapped with a lock, which makes them thread-safe in
free-threaded build. This replaces `PyThread_acquire_lock` with `PyMutex` and
removes some macros and allocation handling code.

Also add a test for free-threading to ensure we aren't getting data races and
that the locking is working.
2025-10-27 09:52:30 -04:00
Itamar Oren
e8b5cb8f33 gh-140641: Break out of inittab search on match (GH-140642) 2025-10-27 15:18:58 +02:00
Victor Stinner
c636477523 gh-140487: Fix Py_RETURN_NOTIMPLEMENTED in limited C API 3.11 (GH-140636)
Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE have already been
fixed by commit 9258f3da91 (issue gh-134989).
2025-10-27 12:59:56 +01:00
Petr Viktorin
18e4a89e42 gh-134160: Add more comments for the xxlimited module (GH-140214) 2025-10-27 11:39:42 +01:00
RayXu
d12086e822 Docs: Replace "encoder" with "decoder" in Doc/c-api/codec.rst (#140613) 2025-10-27 10:43:24 +01:00
Petr Viktorin
3416e7c8dc gh-140633: AppleFrameworkLoader: Ignore AttributeError when setting __file__ (GH-140635) 2025-10-27 10:09:22 +01:00
Shamil
7d70a147f5 Remove dead stores to 'size' in UTF-8 decoder (unicodeobject.c) (#140637) 2025-10-27 11:55:57 +03:00
da-woods
f5da369e20 Fix typo in TLS docs (#140640) 2025-10-27 10:28:30 +05:30
Brian Schubert
3dab11f888 gh-138944: Fix SyntaxError message for invalid syntax following valid import-as statement (#138945) 2025-10-26 22:35:21 +00:00
yihong
9d34623eb1 gh-140609: delete unused _stdlib_enums in enum.py (#140618)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
2025-10-26 18:37:31 +01:00
Bartosz Sławecki
06c779474c gh-137568: Ignore startup file in test_dumb_terminal_exits_cleanly (GH-140295) 2025-10-26 10:48:03 -04:00
Sebastian Pipping
e34a5e3304 gh-140593: Fix a memory leak in function my_ElementDeclHandler of pyexpat (#140602)
Ensure that the memory allocated for the content model
passed to `my_ElementDeclHandler` is freed in all error
paths.
2025-10-26 13:45:32 +00:00
Bénédikt Tran
37827c1752 gh-133346: add tests for _colorize.Theme (#139687) 2025-10-26 12:07:31 +00:00
Bénédikt Tran
387ac2d2f3 gh-133346: make _colorize.Argparse kw-only constructible (#140620)
Other themes are kw-only constructible.
2025-10-26 11:33:57 +00:00
Stan Ulbrych
00026d19c2 gh-76007: Deprecate __version__ attribute in decimal (#140302)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-26 12:01:04 +01:00
RayXu
33b2ca80bb Docs: Fix a grammatical error in Doc/c-api/codec.rst (#140612) 2025-10-26 10:39:32 +01:00
Zachary Ware
421a475c87 gh-124694: Add versionadded note to InterpreterPoolExecutor (#140468) 2025-10-25 18:29:46 -05:00
RayXu
d74a96366d Fix typo in Doc/c-api/code.rst (#140586) 2025-10-25 17:34:45 +02:00
Shamil
2a1c9bd616 Remove unreachable break statements in _ctypes_test.c (#140585) 2025-10-25 14:59:12 +00:00
Kumar Aditya
df07364106 gh-140544: use faster _PyInterpreterState_GET for type lock (#140584) 2025-10-25 14:53:26 +00:00
Kumar Aditya
ef4665f918 gh-140544: store pointer to interpreter state as a thread local for fast access (#140573) 2025-10-25 19:56:07 +05:30
RayXu
4ad599501f Docs: Fix a grammatical error in Doc/c-api/capsule.rst (GH-140577)
"who" -> "which"
2025-10-25 09:54:52 -04:00
Mikhail Efimov
d78d7a50b0 Add missing NEWS entry for gh-140517 (GH-140560) 2025-10-24 22:53:00 +03:00
Tapeline
4f8e7b5ac5 gh-136327: Fix inconsistent `TypeError` messages regarding invalid values after * and ** (#136395) 2025-10-24 19:12:49 +00:00
Barry Warsaw
b3c713a0af gh-140482: Preserve and restore stty echo as a test environment (#140519)
gh-140482: Restore `stty echo` as a test environment
2025-10-24 11:07:08 -07:00
Miša Jakovljević
44b6eead21 gh-140463: Fix typo in xmlrpc.client documentation (GH-140552)
Fix typo in xmlrpc.client documentation
2025-10-24 18:04:43 +02:00
Mikhail Efimov
be5af997f3 gh-140517: fix leak in map_next in strict mode (#140543) 2025-10-24 21:29:16 +05:30
Kumar Aditya
95e5d59630 gh-140414: add fastpath for current running loop in asyncio.all_tasks (#140542)
Optimize `asyncio.all_tasks()` for the common case where the event loop is running in the current thread by avoiding stop-the-world pauses and locking.

This optimization is already present for `asyncio.current_task()` so we do the same for `asyncio.all_tasks()`.
2025-10-24 20:02:17 +05:30
Kumar Aditya
ebf9938496 gh-140544: cleanup HAVE_THREAD_LOCAL checks in pystate.c (#140547) 2025-10-24 14:23:06 +00:00
Petr Viktorin
289360ae63 Document that PyModule_GetDef can return NULL with or without setting an exception (GH-140529) 2025-10-24 15:28:48 +02:00
RayXu
fc2e23c2ed Docs: Fix a grammatical error in Doc/c-api/arg.rst (GH-140525)
"have" -> "has"
2025-10-24 08:17:52 -04:00
Jiseok CHOI
aa4b5a77f3 gh-136535: Tests: Correct Py_TPFLAGS_MANAGED_DICT in test_class.py (gh-136538) 2025-10-24 20:20:09 +09:00
sobolevn
92c0c45563 gh-138857: Improve error message for case outside of match (#138858)
* gh-138857: Improve error message for `case` outside of `match`

---------

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
2025-10-24 11:20:54 +02:00
Tan Long
161b3064ef gh-133390: sqlite3 CLI completion for tables, columns, indices, triggers, views, functions, schemata (GH-136101) 2025-10-24 08:26:36 +02:00
Victor Stinner
5d2edf72d2 gh-83714: Set os.statx().stx_mode to None if missing from stx_mask (#140484)
* Set stx_mode to None if STATX_TYPE|STATX_MODE is missing from
  stx_mask.
* Enhance os.statx() tests.
* statx_result structure: remove atime_sec, btime_sec, ctime_sec and
  mtime_sec members. Compute them on demand when stx_atime,
  stx_btime, stx_ctime and stx_mtime are read.
* Doc: fix statx members sorting.
2025-10-23 22:35:17 +02:00
Abhishek Tiwari
f0291c3f2d gh-140443: Use fma in loghelper to improve accuracy of log for very large integers (#140469)
* gh-140443:use fma in loghelper to improve accuracy of log for very large integers

Use fused multiply-add in log_helper() for huge ints.

Saving a rounding here is remarkably effective. Across some millions
of randomized test cases with ints up to a billion bits, on Windows
and using log10, the ULP error distribution was dramatically
flattened, and its range was nearly cut in half. In fact, the largest
error Tim saw was under 0.6 ULP.

---------

Co-authored-by: abhi210 <27881020+Abhi210@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-23 12:05:12 -05:00
Mikhail Efimov
918a9ac9f4 gh-135125: Fix Py_STACKREF_DEBUG build (GH-139475)
* Use the same pattern of refcounting for stackrefs as in production build
2025-10-23 17:00:23 +01:00
Mark Shannon
61e759c2ee GH-135904: JIT compiler: Support 19 bit branch instructions on AArch64 for Mach-O. (GH-140453)
* Insert labels into assembly for custom relocation during stencil creation.
2025-10-23 16:45:57 +01:00
Stan Ulbrych
95953b692d gh-140471: Fix buffer overflow in AST node initialization with malformed _fields (#140506) 2025-10-23 15:35:21 +00:00
Bartosz Sławecki
1a3da2c070 gh-140438: properly run the asyncio REPL tests (#140298) 2025-10-23 20:53:23 +05:30
Sam Gross
574405c19e gh-140431: Fix GC crash due to partially initialized coroutines (gh-140470)
The `make_gen()` function creates and tracks generator/coro objects, but
doesn't fully initialize all the fields. At a minimum, we need to
initialize all the fields that may be accessed by gen_traverse because
the call to `compute_cr_origin()` can trigger a GC.
2025-10-23 10:18:13 -04:00
George Ogden
4d0849426f gh-138774: use value to ast.unparse code when str is None in ast.Interpolation (#139415) 2025-10-23 13:56:05 +00:00
Maurycy Pawłowski-Wieroński
6be6f8ff59 gh-137627: Make csv.Sniffer.sniff() delimiter detection 1.6x faster (#137628)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-10-23 15:28:29 +03:00
Stan Ulbrych
aa9d0a61d5 gh-140474: Fix memory leak in array.array (GH-140478) 2025-10-23 05:49:27 -04:00
Brett Cannon
bd2c7e8c8b GH-140472: Create a WASI devcontainer configuration (GH-140473) 2025-10-22 16:11:48 -07:00
Brett Cannon
e5f4299f13 GH-140475: Support WASI SDK 25 (#140477)
As well, bump the version of Wasmtime used in CI.
2025-10-22 14:34:37 -07:00