Commit Graph

128892 Commits

Author SHA1 Message Date
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
Bartosz Sławecki
b3b0d75069 gh-140253: Improve the syntax error from an ill-positioned double-star subpattern (#140254) 2025-10-22 21:29:14 +03:00
Stefano Rivera
76fea5596c gh-130317: Fix SNaN broken tests on HP PA RISC (#140452)
While looking at #140028, I found some unrelated test regressions in the
3.14 cycle. These seem to all come from #130317. From what I can tell,
that made Python more correct than it was before. According to [0], HP PA
RISC uses 1 for SNaN and thus a 0 for QNaN.

[0]: https://grouper.ieee.org/groups/1788/email/msg03272.html
2025-10-22 18:36:12 +02:00
Jakob
d2f3cfd384 gh-140448: Default suggest_on_error to True in argparse.ArgumentParser (#140450) 2025-10-22 16:15:26 +00:00
Alper
d51be28876 gh-116738: Add critical section to dbm/gdbm context manager (gh-140391) 2025-10-22 11:16:28 -04:00
Sergey Miryanov
a4709e525f GH-139193: Fix dump_stack when PYTHON_LLTRACE=4 (GH-139384) 2025-10-22 14:14:25 +01:00
Petr Viktorin
e53e9eb2f1 gh-83714: Only use STATX_MNT_ID & STATX_SUBVOL if they're defined (GH-140446) 2025-10-22 12:42:51 +02:00
Victor Stinner
7339cf7899 gh-83714: Use "stx_" prefix for all os.statx_result members (#140432)
Rename stx_birthtime to stx_btime, and rename stx_birthtime_ns to
stx_btime_ns.
2025-10-22 11:48:37 +02:00
Alper
b3a38438d8 gh-116738: Make _suggestions module thread-safe (gh-140321) 2025-10-22 09:14:48 +09:00
Russell Keith-Magee
29b38b7aae gh-55258: Skip tests of stdout status on mobile platforms (#140401)
Skip tests of stdout status on mobile platforms.
2025-10-22 07:12:26 +08:00
Emma Smith
a8edca62fc gh-132835: Add defensive NULL checks to MRO resolution (GH-134763)
Currently, there are a few places where tp_mro could theoretically
become NULL, but do not in practice. This commit adds defensive checks for
NULL values to ensure that any changes do not introduce a crash and that
state invariants are upheld.

The assertions added in this commit are all instances where a NULL value would get passed to something not expecting a NULL, so it is better to catch an assertion failure than crash later on.

There are a few cases where it is OK for the return of lookup_tp_mro to be NULL, such as when passed to is_subtype_with_mro, which handles this explicitly.
2025-10-21 14:48:29 -07:00
Stan Ulbrych
02c1abfc54 gh-69528: Distinguish between file modes "wb+" and "rb+" (GH-137834)
Co-authored-by: Xiang Zhang <angwerzx@126.com>
2025-10-21 20:33:30 +03:00
Jeffrey Bosboom
60df1d7e0c gh-83714: Check for struct statx members in configure (#140402)
Some systems have the definitions of the mask bits without having the
corresponding members in struct statx.  Add configure checks for members
added after Linux 4.11 (when statx itself was added).
2025-10-21 18:13:14 +02:00