126708 Commits

Author SHA1 Message Date
Victor Stinner
0f23e84cda
gh-130317: Skip test_pack_unpack_roundtrip_for_nans() on x86 (#133155)
Reduce also the number of iterations from 1000 to 10 to ease
debugging failures and prevent "command line too line" error when
tests are re-run.
2025-04-30 12:01:06 +02:00
Lysandros Nikolaou
60202609a2
gh-132661: Implement PEP 750 (#132662)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wingy <git@wingysam.xyz>
Co-authored-by: Koudai Aono <koxudaxi@gmail.com>
Co-authored-by: Dave Peck <davepeck@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Paul Everitt <pauleveritt@me.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
2025-04-30 11:46:41 +02:00
sobolevn
5ea9010e89
gh-133117: Run mypy on tomllib in CI (#133118) 2025-04-30 11:45:58 +03:00
Rafael Fontenelle
fd0f5d0a5e
Remove trailing whitespace from python.gram (#133175) 2025-04-30 10:35:15 +02:00
Russell Keith-Magee
58a0f40f1f
gh-127604: Optimize -ldl usage on platforms that use dlopen for libFFI. (#133081)
Optimize -ldl usage on platforms that use dlopen for libFFI.
2025-04-30 16:28:31 +08:00
sobolevn
c4b7f7c7ff
Add profile-gen-stamp to .gitignore (#133188) 2025-04-30 07:53:45 +00:00
Shantanu
7e8b153fef
gh-116436: Improve error message when TypeError occurs during dict update (#116443) 2025-04-29 22:18:06 -07:00
Inada Naoki
4e294f6feb
gh-133036: Deprecate codecs.open (#133038)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-04-30 10:11:09 +09:00
Brandt Bucher
732d1b0241
Get rid of ERROR_IF's "label" parameter (GH-132654) 2025-04-29 17:21:53 -07:00
Brandt Bucher
b329096cfb
GH-125515: Mark code after "return" as unreachable in the cases generator (#133178)
Mark code after "return" as unreachable
2025-04-30 00:21:14 +00:00
Russell Keith-Magee
42b0b0667e
gh-133131: Discover an appropriate iOS simulator rather than hard-coding iPhone SE 3rd gen (#133132)
Determines a candidate simulator at runtime rather than hardcoding iPhone SE.
2025-04-30 05:35:36 +08:00
Serhiy Storchaka
c46635aa5a
gh-120220: Deprecate legacy methods for tracing variables in Tkinter (GH-120223)
They do not work with Tcl 9.0.
Use new methods added in Python 3.6.
2025-04-29 20:26:51 +03:00
Yongzi Li
814ca116d5
Docs: fix typo in InternalDocs/garbage_collector.md (gh-133151)
Fix typo in `InternalDocs/garbage_collector.md`.
2025-04-29 17:20:50 +00:00
Mark Shannon
ccf1b0b1c1
GH-132508: Use tagged integers on the evaluation stack for the last instruction offset (GH-132545) 2025-04-29 18:00:35 +01:00
Tian Gao
caee16f052
gh-121468: Support async breakpoint in pdb (#132576) 2025-04-29 12:28:24 -04:00
Serhiy Storchaka
4265854d96
gh-132987: Support __index__() in the socket module (GH-133093)
ntohl(), htonl(), if_indextoname(), getaddrinfo() now use __index__() if
available.

Also fix the Argument Clinic names for module-level functions (although
this does not affect the user).
2025-04-29 19:27:07 +03:00
Serhiy Storchaka
c33efa8735
gh-132987: Support __index__() in the stat module (GH-133097)
Use it for the mode arguments in filemode(), S_IMODE(), S_ISDIR(), etc.
2025-04-29 19:25:44 +03:00
Chris Eibl
acb222ce8f
GH-130328: pasting in new REPL is slow on Windows (GH-132884) 2025-04-29 18:03:45 +02:00
Steve Dower
ae37f3d3c0
gh-132930: Fixes PEP 514 registration for PyManager packages on x64 (GH-133154) 2025-04-29 16:20:41 +01:00
Victor Stinner
02cd6d7097
gh-130317: Fix strict aliasing in PyFloat_Pack8() (#133150)
* Fix strict aliasing in PyFloat_Pack8() and PyFloat_Pack4().
* Fix _testcapi.float_set_snan() on x86 (32-bit).
2025-04-29 14:27:50 +00:00
Johannes Holmberg
698c6e3a0c
gh-132933: zipapp - apply the filter when creating the list of files to add (gh-132934) 2025-04-29 15:14:46 +01:00
Serhiy Storchaka
a64fdc7513
gh-132987: Support __index__() in the lzma module (GH-133099) 2025-04-29 14:14:33 +00:00
Serhiy Storchaka
d2d490064d
gh-132987: Support __index__() in the select.kqueue_event constructor (GH-133094) 2025-04-29 13:55:14 +00:00
Serhiy Storchaka
0fb4c38c27
gh-132987: Support __index__() in the ssl.SSLContext.options setter (GH-133098) 2025-04-29 16:28:47 +03:00
Serhiy Storchaka
d6da6803a1
gh-132987: Support __index__() in hashlib.scrypt() (GH-133100)
Even if such signature is not supported by PyArg_ParseTupleAndKeywords(),
Argument Clinic supports it with inlined converters.
2025-04-29 16:16:05 +03:00
Serhiy Storchaka
07edc0d2b2
gh-132987: Support __index__() in the posix module (GH-133096)
Support it for the dev_t values in mknod(), major(), minor() and makedev(),
CPU numbers in sched_setaffinity(), group numbers in setgroups(),
configuration name in fpathconf(), pathconf(), confstr(), and sysconf().
2025-04-29 16:14:47 +03:00
Stan Ulbrych
bba14c3e01
gh-46236: Document PyUnicodeIter_Type (GH-132925) 2025-04-29 14:23:06 +02:00
Stan Ulbrych
59ff42155a
gh-57281: Fix duplicate deprecation note: array 'u' format (#133113) 2025-04-29 13:22:15 +02:00
Petr Viktorin
0c26dbd16e
gh-133079: Remove Py_C_RECURSION_LIMIT & PyThreadState.c_recursion_remaining (GH-133080)
Both were added in 3.13, are undocumented, and don't make sense in 3.14 due to
changes in the stack overflow detection machinery (gh-112282).

PEP 387 exception for skipping a deprecation period: https://github.com/python/steering-council/issues/288
2025-04-29 12:56:20 +02:00
Adam Turner
208d06fd51
gh-132930: Fix use of ALIAS_WPREFIX in pymanager builds (GH-133120) 2025-04-29 08:53:43 +00:00
Adam Turner
4d54e9cdf6
GH-132930: Display 'free-threaded' in pymanager builds (GH-133119) 2025-04-29 09:28:04 +01:00
Mark Shannon
622300bdfa
GH-132554: Add stats for GET_ITER (GH-132592)
* Add stats for GET_ITER

* Look for common iterable types, not iterator types

* Add stats for self iter and fix naming in summary
2025-04-29 09:00:14 +01:00
sobolevn
01f11a0e4e
Run mypy workflow on _colorize.py and Misc/mypy/** changes (#133116)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-29 07:53:12 +00:00
Neil Schemenauer
eecafc3380
Revert gh-127266: avoid data races when updating type slots (gh-131174) (gh-133129)
This is triggering deadlocks in test_opcache.  See GH-133130 for stack trace.
2025-04-28 23:38:29 -07:00
Raymond Hettinger
219b1f9d1d
gh-132893: Minor edits to the statistics module PR (gh-133106) 2025-04-28 23:05:37 -05:00
Eric Snow
219d8d24b5
gh-87859: Track Code Object Local Kinds For Arguments (gh-132980)
Doing this was always the intention. I was finally motivated to find the time to do it.

See #87859 (comment).
2025-04-29 02:21:47 +00:00
Eric Snow
96a7fb93a8
gh-132775: Add _PyCode_ReturnsOnlyNone() (gh-132981)
The function indicates whether or not the function has a return statement.

This is used by a later change related treating some functions like scripts.
2025-04-28 20:12:52 -06:00
Donghee Na
75cbb8d89e
gh-132070: Use _PyObject_IsUniquelyReferenced in unicodeobject (gh-133039)
---------

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-29 09:48:53 +09:00
Eric Snow
bdd23c0bb9
gh-132775: Add _PyMarshal_GetXIData() (gh-133108)
Note that the bulk of this change is tests.
2025-04-28 17:23:46 -06:00
Neil Schemenauer
68a737691b
gh-125142: add REPL help text for keyboard shortcuts (gh-125143) 2025-04-28 14:17:34 -07:00
Neil Schemenauer
31a500a92b
Add internal docs about the free-threaded GC. (gh-132562) 2025-04-28 13:32:39 -07:00
Neil Schemenauer
e414a2d81c
gh-127266: avoid data races when updating type slots (gh-131174)
In the free-threaded build, avoid data races caused by updating type slots
or type flags after the type was initially created.  For those (typically
rare) cases, use the stop-the-world mechanism.  Remove the use of atomics
when reading or writing type flags.  The use of atomics is not sufficient to
avoid races (since flags are sometimes read without a lock and without
atomics) and are no longer required.
2025-04-28 20:28:44 +00:00
Neil Schemenauer
22f0730d40
gh-122320: Limit dict key versions used by test_opcache. (gh-132961)
The `test_load_global_module()` test consumes a lot of dict key versions.
Skip the test if we have consumed half of the available versions that can be
used for the "load global" cache.
2025-04-28 12:54:55 -07:00
Barney Gale
336322b341
GH-128520: pathlib ABCs tests: use explicit text encoding (#133105)
Follow-up to fbffd70. Set `encoding='utf-8'` when reading and writing text
in the tests for the private pathlib ABCs, which allows the tests to run
with `-W error -X warn_default_encoding`
2025-04-28 20:18:56 +01:00
Eric Snow
606003ffa9
gh-132775: Add _PyBytes_GetXIData() (gh-133101)
This is the base for several other XIData wrappers, like pickle and marshal. It is essentially a refactor of the existing bytes XIData code.
2025-04-28 12:52:36 -06:00
Neil Schemenauer
31d1342de9
gh-132942: Fix races in type lookup cache (gh-133032)
Two races related to the type lookup cache, when used in the
free-threaded build.  This caused test_opcache to sometimes fail (as
well as other hard to re-produce failures).
2025-04-28 11:52:08 -07:00
Eric Snow
fe462f5a91
gh-132775: Drop PyUnstable_InterpreterState_GetMainModule() (gh-132978)
We replace it with _Py_GetMainModule(), and add _Py_CheckMainModule(), but both in the internal-only C-API.  We also add _PyImport_GetModulesRef(), which is the equivalent of _PyImport_GetModules(), but which increfs before the lock is released.

This is used by a later change related to pickle and handling __main__.
2025-04-28 12:46:22 -06:00
Eric Snow
c17238251f
gh-132775: Add _PyModule_GetFilenameObject() and _PyModule_GetFilenameUTF8() (gh-132979)
They are derived from the existing `PyModule_GetFilenameObject().

They are used by a later change related to pickle and handling __main__.
2025-04-28 12:41:32 -06:00
Serhiy Storchaka
25186c2472
gh-132742: Fix newly added tcflush() tests on Android (GH-133070) 2025-04-28 21:41:09 +03:00
Steve Dower
3940e1f873
gh-132930: Improve the names of IDLE and PyDoc shortcuts (GH-133091) 2025-04-28 19:09:20 +01:00