]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
6 months agogh-124715: Fix method_dealloc(): use PyObject_GC_UnTrack() (#133199)
Victor Stinner [Thu, 1 May 2025 11:42:42 +0000 (13:42 +0200)] 
gh-124715: Fix method_dealloc(): use PyObject_GC_UnTrack() (#133199)

Replace _PyObject_GC_UNTRACK() with PyObject_GC_UnTrack() to not fail
if the method was already untracked.

6 months agogh-130655: Add a test for big-endian MO files in gettext (GH-132469)
Tomas R. [Thu, 1 May 2025 11:13:08 +0000 (13:13 +0200)] 
gh-130655: Add a test for big-endian MO files in gettext (GH-132469)

6 months agoRemove duplicate includes: Python/{bytecodes,ceval,optimizer_analysis}.c (#132622)
Adam Turner [Thu, 1 May 2025 11:07:53 +0000 (12:07 +0100)] 
Remove duplicate includes: Python/{bytecodes,ceval,optimizer_analysis}.c (#132622)

6 months agogh-100239: specialize BINARY_OP/SUBSCR for list-slice (#132626)
Irit Katriel [Thu, 1 May 2025 10:28:52 +0000 (11:28 +0100)] 
gh-100239: specialize BINARY_OP/SUBSCR for list-slice (#132626)

6 months agoPyStats: Make sure that the `failure_kinds` array is big enough. (#133245)
Mark Shannon [Thu, 1 May 2025 10:02:51 +0000 (11:02 +0100)] 
PyStats: Make sure that the `failure_kinds` array is big enough. (#133245)

6 months agoLint: Create a project-wide ``.ruff.toml`` settings file (#133124)
Adam Turner [Thu, 1 May 2025 08:28:44 +0000 (09:28 +0100)] 
Lint: Create a project-wide ``.ruff.toml`` settings file (#133124)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
6 months agogh-133196: Guard PEP 750 grammar with `CHECK_VERSION` (#133225)
sobolevn [Thu, 1 May 2025 07:17:07 +0000 (10:17 +0300)] 
gh-133196: Guard PEP 750 grammar with `CHECK_VERSION` (#133225)

6 months agogh-131531: Make Android build retry after network failures (#133193)
Malcolm Smith [Thu, 1 May 2025 04:17:41 +0000 (05:17 +0100)] 
gh-131531: Make Android build retry after network failures (#133193)

Adds a retry strategy when downloading compilation resources for Android, plus some other cleanups.

6 months agogh-130167: Improve ``difflib.IS_LINE_JUNK`` performance by using string methods ...
Semyon Moroz [Thu, 1 May 2025 04:11:36 +0000 (08:11 +0400)] 
gh-130167: Improve ``difflib.IS_LINE_JUNK`` performance by using string methods (#130170)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Tim Peters <tim.peters@gmail.com>
6 months agoAdd missing whitespace in `is_running_main` comment (#133174)
Nybblista [Thu, 1 May 2025 03:36:59 +0000 (06:36 +0300)] 
Add missing whitespace in `is_running_main` comment (#133174)

6 months agoBump the HACL* revision. (#133226)
Russell Keith-Magee [Thu, 1 May 2025 02:57:49 +0000 (10:57 +0800)] 
Bump the HACL* revision. (#133226)

Bump the HACL* revision to include iOS platform identification.

6 months agogh-133183: Include IPHONEOS_DEPLOYMENT_TARGET in iOS shim targets. (#133184)
Russell Keith-Magee [Thu, 1 May 2025 02:35:33 +0000 (10:35 +0800)] 
gh-133183: Include IPHONEOS_DEPLOYMENT_TARGET in iOS shim targets. (#133184)

Include IPHONEOS_DEPLOYMENT_TARGET in iOS shim targets.

6 months agoRevert "gh-132775: Add _PyCode_GetVarCounts() (gh-133128)" (gh-133232)
Eric Snow [Thu, 1 May 2025 02:35:20 +0000 (20:35 -0600)] 
Revert "gh-132775: Add _PyCode_GetVarCounts() (gh-133128)" (gh-133232)

The change broke the s390 builds, so I'm reverting it while I investigate.

This reverts commit 94b4fcd806e7b692955173d309ea3b70a193ad96.

6 months agodict: Remove redundant incref of immortal object Py_EMPTY_KEYS (GH-133200)
Mae Hood [Wed, 30 Apr 2025 23:39:26 +0000 (00:39 +0100)] 
dict: Remove redundant incref of immortal object Py_EMPTY_KEYS (GH-133200)

6 months agogh-132775: Add _PyPickle_GetXIData() (gh-133107)
Eric Snow [Wed, 30 Apr 2025 23:34:05 +0000 (17:34 -0600)] 
gh-132775: Add _PyPickle_GetXIData() (gh-133107)

There's some extra complexity due to making sure we we get things right when handling functions and classes defined in the __main__ module.  This is also reflected in the tests, including the addition of extra functions in test.support.import_helper.

6 months agoGH-125515: Remove two unused error branches. (#133181)
Russell Keith-Magee [Wed, 30 Apr 2025 22:21:57 +0000 (06:21 +0800)] 
GH-125515: Remove two unused error branches. (#133181)

Remove two unused error branches in the generated bytecode handling.

6 months agogh-133153: Use rlcompleter for pdb's interact command (#133176)
Tian Gao [Wed, 30 Apr 2025 22:19:13 +0000 (15:19 -0700)] 
gh-133153: Use rlcompleter for pdb's interact command (#133176)

6 months agogh-133213: Add tests for `string.templatelib.TemplateIter` (#133215)
sobolevn [Wed, 30 Apr 2025 19:38:25 +0000 (22:38 +0300)] 
gh-133213: Add tests for `string.templatelib.TemplateIter` (#133215)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
6 months agogh-132775: Add _PyCode_GetVarCounts() (gh-133128)
Eric Snow [Wed, 30 Apr 2025 18:19:20 +0000 (12:19 -0600)] 
gh-132775: Add _PyCode_GetVarCounts() (gh-133128)

This helper is useful in a variety of ways, including in demonstrating how the different counts relate to one another.

It will be used in a later change to help identify if a function is "stateless", meaning it doesn't have any free vars or globals.

Note that a majority of this change is tests.

6 months agoGH-114809: Add support for macOS multi-arch builds with the JIT enabled (#131751)
Savannah Ostrowski [Wed, 30 Apr 2025 18:03:57 +0000 (11:03 -0700)] 
GH-114809: Add support for macOS multi-arch builds with the JIT enabled (#131751)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
6 months agoApply 'mod' role to typing module (#133201)
Rafael Fontenelle [Wed, 30 Apr 2025 16:52:03 +0000 (13:52 -0300)] 
Apply 'mod' role to typing module (#133201)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
6 months agogh-133197: Improve error message for `ft""` and `bt""` cases (#133202)
sobolevn [Wed, 30 Apr 2025 16:20:44 +0000 (19:20 +0300)] 
gh-133197: Improve error message for `ft""` and `bt""` cases (#133202)

6 months agoRemove redundant ``--keep-going`` when running Sphinx (#133156)
Hugo van Kemenade [Wed, 30 Apr 2025 16:12:28 +0000 (19:12 +0300)] 
Remove redundant ``--keep-going`` when running Sphinx (#133156)

6 months agogh-133211: Test that PEP750 types are final (#133212)
sobolevn [Wed, 30 Apr 2025 16:03:19 +0000 (19:03 +0300)] 
gh-133211: Test that PEP750 types are final (#133212)

6 months agogh-133167: Fix compilation process with `--enable-optimizations` and `--without-docst...
sobolevn [Wed, 30 Apr 2025 13:41:50 +0000 (16:41 +0300)] 
gh-133167: Fix compilation process with `--enable-optimizations` and `--without-docstrings` (#133187)

6 months agogh-87135: test_threading: Wait on thread, not an Event it sets (GH-133198)
Petr Viktorin [Wed, 30 Apr 2025 13:14:24 +0000 (15:14 +0200)] 
gh-87135: test_threading: Wait on thread, not an Event it sets (GH-133198)

When the event is set the thread might not be done yet.

This is a fix-up for commit 4ebbfcf30e0e2d87ff6036d4d1de0f6f0ef7c46a

6 months agogh-131591: Add tests for _PdbClient (#132976)
Matt Wozniski [Wed, 30 Apr 2025 13:09:41 +0000 (09:09 -0400)] 
gh-131591: Add tests for _PdbClient (#132976)

6 months agogh-89867: string.Formatter auto numbering doc updates (GH-129617)
dgpb [Wed, 30 Apr 2025 12:24:40 +0000 (15:24 +0300)] 
gh-89867: string.Formatter auto numbering doc updates (GH-129617)

6 months agogh-133194: Add `CHECK_VERSION` to new PEP758 grammar (#133195)
sobolevn [Wed, 30 Apr 2025 10:39:26 +0000 (13:39 +0300)] 
gh-133194: Add `CHECK_VERSION` to new PEP758 grammar (#133195)

6 months agoGH-124715: Move trashcan mechanism into `Py_Dealloc` (GH-132280)
Mark Shannon [Wed, 30 Apr 2025 10:37:53 +0000 (11:37 +0100)] 
GH-124715: Move trashcan mechanism into `Py_Dealloc` (GH-132280)

6 months agogh-130317: Skip test_pack_unpack_roundtrip_for_nans() on x86 (#133155)
Victor Stinner [Wed, 30 Apr 2025 10:01:06 +0000 (12:01 +0200)] 
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.

6 months agogh-132661: Implement PEP 750 (#132662)
Lysandros Nikolaou [Wed, 30 Apr 2025 09:46:41 +0000 (11:46 +0200)] 
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>
6 months agogh-133117: Run mypy on `tomllib` in CI (#133118)
sobolevn [Wed, 30 Apr 2025 08:45:58 +0000 (11:45 +0300)] 
gh-133117: Run mypy on `tomllib` in CI (#133118)

6 months agoRemove trailing whitespace from python.gram (#133175)
Rafael Fontenelle [Wed, 30 Apr 2025 08:35:15 +0000 (05:35 -0300)] 
Remove trailing whitespace from python.gram (#133175)

6 months agogh-127604: Optimize -ldl usage on platforms that use dlopen for libFFI. (#133081)
Russell Keith-Magee [Wed, 30 Apr 2025 08:28:31 +0000 (16:28 +0800)] 
gh-127604: Optimize -ldl usage on platforms that use dlopen for libFFI. (#133081)

Optimize -ldl usage on platforms that use dlopen for libFFI.

6 months agoAdd `profile-gen-stamp` to `.gitignore` (#133188)
sobolevn [Wed, 30 Apr 2025 07:53:45 +0000 (10:53 +0300)] 
Add `profile-gen-stamp` to `.gitignore` (#133188)

6 months agogh-116436: Improve error message when TypeError occurs during dict update (#116443)
Shantanu [Wed, 30 Apr 2025 05:18:06 +0000 (22:18 -0700)] 
gh-116436: Improve error message when TypeError occurs during dict update (#116443)

6 months agogh-133036: Deprecate codecs.open (#133038)
Inada Naoki [Wed, 30 Apr 2025 01:11:09 +0000 (10:11 +0900)] 
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>
6 months agoGet rid of ERROR_IF's "label" parameter (GH-132654)
Brandt Bucher [Wed, 30 Apr 2025 00:21:53 +0000 (17:21 -0700)] 
Get rid of ERROR_IF's "label" parameter (GH-132654)

6 months agoGH-125515: Mark code after "return" as unreachable in the cases generator (#133178)
Brandt Bucher [Wed, 30 Apr 2025 00:21:14 +0000 (17:21 -0700)] 
GH-125515: Mark code after "return" as unreachable in the cases generator (#133178)

Mark code after "return" as unreachable

6 months agogh-133131: Discover an appropriate iOS simulator rather than hard-coding iPhone SE...
Russell Keith-Magee [Tue, 29 Apr 2025 21:35:36 +0000 (05:35 +0800)] 
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.

6 months agogh-120220: Deprecate legacy methods for tracing variables in Tkinter (GH-120223)
Serhiy Storchaka [Tue, 29 Apr 2025 17:26:51 +0000 (20:26 +0300)] 
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.

6 months agoDocs: fix typo in `InternalDocs/garbage_collector.md` (gh-133151)
Yongzi Li [Tue, 29 Apr 2025 17:20:50 +0000 (01:20 +0800)] 
Docs: fix typo in `InternalDocs/garbage_collector.md` (gh-133151)

Fix typo in `InternalDocs/garbage_collector.md`.

6 months agoGH-132508: Use tagged integers on the evaluation stack for the last instruction offse...
Mark Shannon [Tue, 29 Apr 2025 17:00:35 +0000 (18:00 +0100)] 
GH-132508: Use tagged integers on the evaluation stack for the last instruction offset (GH-132545)

6 months agogh-121468: Support async breakpoint in pdb (#132576)
Tian Gao [Tue, 29 Apr 2025 16:28:24 +0000 (09:28 -0700)] 
gh-121468: Support async breakpoint in pdb (#132576)

6 months agogh-132987: Support __index__() in the socket module (GH-133093)
Serhiy Storchaka [Tue, 29 Apr 2025 16:27:07 +0000 (19:27 +0300)] 
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).

6 months agogh-132987: Support __index__() in the stat module (GH-133097)
Serhiy Storchaka [Tue, 29 Apr 2025 16:25:44 +0000 (19:25 +0300)] 
gh-132987: Support __index__() in the stat module (GH-133097)

Use it for the mode arguments in filemode(), S_IMODE(), S_ISDIR(), etc.

6 months agoGH-130328: pasting in new REPL is slow on Windows (GH-132884)
Chris Eibl [Tue, 29 Apr 2025 16:03:45 +0000 (18:03 +0200)] 
GH-130328: pasting in new REPL is slow on Windows (GH-132884)

6 months agogh-132930: Fixes PEP 514 registration for PyManager packages on x64 (GH-133154)
Steve Dower [Tue, 29 Apr 2025 15:20:41 +0000 (16:20 +0100)] 
gh-132930: Fixes PEP 514 registration for PyManager packages on x64 (GH-133154)

6 months agogh-130317: Fix strict aliasing in PyFloat_Pack8() (#133150)
Victor Stinner [Tue, 29 Apr 2025 14:27:50 +0000 (16:27 +0200)] 
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).

6 months agogh-132933: zipapp - apply the filter when creating the list of files to add (gh-132934)
Johannes Holmberg [Tue, 29 Apr 2025 14:14:46 +0000 (16:14 +0200)] 
gh-132933: zipapp - apply the filter when creating the list of files to add (gh-132934)

6 months agogh-132987: Support __index__() in the lzma module (GH-133099)
Serhiy Storchaka [Tue, 29 Apr 2025 14:14:33 +0000 (17:14 +0300)] 
gh-132987: Support __index__() in the lzma module (GH-133099)

6 months agogh-132987: Support __index__() in the select.kqueue_event constructor (GH-133094)
Serhiy Storchaka [Tue, 29 Apr 2025 13:55:14 +0000 (16:55 +0300)] 
gh-132987: Support __index__() in the select.kqueue_event constructor (GH-133094)

6 months agogh-132987: Support __index__() in the ssl.SSLContext.options setter (GH-133098)
Serhiy Storchaka [Tue, 29 Apr 2025 13:28:47 +0000 (16:28 +0300)] 
gh-132987: Support __index__() in the ssl.SSLContext.options setter (GH-133098)

6 months agogh-132987: Support __index__() in hashlib.scrypt() (GH-133100)
Serhiy Storchaka [Tue, 29 Apr 2025 13:16:05 +0000 (16:16 +0300)] 
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.

6 months agogh-132987: Support __index__() in the posix module (GH-133096)
Serhiy Storchaka [Tue, 29 Apr 2025 13:14:47 +0000 (16:14 +0300)] 
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().

6 months agogh-46236: Document `PyUnicodeIter_Type` (GH-132925)
Stan Ulbrych [Tue, 29 Apr 2025 12:23:06 +0000 (13:23 +0100)] 
gh-46236: Document `PyUnicodeIter_Type` (GH-132925)

6 months agogh-57281: Fix duplicate deprecation note: array 'u' format (#133113)
Stan Ulbrych [Tue, 29 Apr 2025 11:22:15 +0000 (12:22 +0100)] 
gh-57281: Fix duplicate deprecation note: array 'u' format (#133113)

6 months agogh-133079: Remove Py_C_RECURSION_LIMIT & PyThreadState.c_recursion_remaining (GH...
Petr Viktorin [Tue, 29 Apr 2025 10:56:20 +0000 (12:56 +0200)] 
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

6 months agogh-132930: Fix use of ALIAS_WPREFIX in pymanager builds (GH-133120)
Adam Turner [Tue, 29 Apr 2025 08:53:43 +0000 (09:53 +0100)] 
gh-132930: Fix use of ALIAS_WPREFIX in pymanager builds (GH-133120)

6 months agoGH-132930: Display 'free-threaded' in pymanager builds (GH-133119)
Adam Turner [Tue, 29 Apr 2025 08:28:04 +0000 (09:28 +0100)] 
GH-132930: Display 'free-threaded' in pymanager builds (GH-133119)

6 months agoGH-132554: Add stats for GET_ITER (GH-132592)
Mark Shannon [Tue, 29 Apr 2025 08:00:14 +0000 (09:00 +0100)] 
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

6 months agoRun mypy workflow on `_colorize.py` and `Misc/mypy/**` changes (#133116)
sobolevn [Tue, 29 Apr 2025 07:53:12 +0000 (10:53 +0300)] 
Run mypy workflow on `_colorize.py` and `Misc/mypy/**` changes (#133116)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
6 months agoRevert gh-127266: avoid data races when updating type slots (gh-131174) (gh-133129)
Neil Schemenauer [Tue, 29 Apr 2025 06:38:29 +0000 (23:38 -0700)] 
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.

6 months agogh-132893: Minor edits to the statistics module PR (gh-133106)
Raymond Hettinger [Tue, 29 Apr 2025 04:05:37 +0000 (23:05 -0500)] 
gh-132893: Minor edits to the statistics module PR (gh-133106)

6 months agogh-87859: Track Code Object Local Kinds For Arguments (gh-132980)
Eric Snow [Tue, 29 Apr 2025 02:21:47 +0000 (20:21 -0600)] 
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).

6 months agogh-132775: Add _PyCode_ReturnsOnlyNone() (gh-132981)
Eric Snow [Tue, 29 Apr 2025 02:12:52 +0000 (20:12 -0600)] 
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.

6 months agogh-132070: Use _PyObject_IsUniquelyReferenced in unicodeobject (gh-133039)
Donghee Na [Tue, 29 Apr 2025 00:48:53 +0000 (09:48 +0900)] 
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>
6 months agogh-132775: Add _PyMarshal_GetXIData() (gh-133108)
Eric Snow [Mon, 28 Apr 2025 23:23:46 +0000 (17:23 -0600)] 
gh-132775: Add _PyMarshal_GetXIData() (gh-133108)

Note that the bulk of this change is tests.

6 months agogh-125142: add REPL help text for keyboard shortcuts (gh-125143)
Neil Schemenauer [Mon, 28 Apr 2025 21:17:34 +0000 (14:17 -0700)] 
gh-125142: add REPL help text for keyboard shortcuts (gh-125143)

6 months agoAdd internal docs about the free-threaded GC. (gh-132562)
Neil Schemenauer [Mon, 28 Apr 2025 20:32:39 +0000 (13:32 -0700)] 
Add internal docs about the free-threaded GC. (gh-132562)

6 months agogh-127266: avoid data races when updating type slots (gh-131174)
Neil Schemenauer [Mon, 28 Apr 2025 20:28:44 +0000 (13:28 -0700)] 
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.

6 months agogh-122320: Limit dict key versions used by test_opcache. (gh-132961)
Neil Schemenauer [Mon, 28 Apr 2025 19:54:55 +0000 (12:54 -0700)] 
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.

6 months agoGH-128520: pathlib ABCs tests: use explicit text encoding (#133105)
Barney Gale [Mon, 28 Apr 2025 19:18:56 +0000 (20:18 +0100)] 
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`

6 months agogh-132775: Add _PyBytes_GetXIData() (gh-133101)
Eric Snow [Mon, 28 Apr 2025 18:52:36 +0000 (12:52 -0600)] 
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.

6 months agogh-132942: Fix races in type lookup cache (gh-133032)
Neil Schemenauer [Mon, 28 Apr 2025 18:52:08 +0000 (11:52 -0700)] 
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).

6 months agogh-132775: Drop PyUnstable_InterpreterState_GetMainModule() (gh-132978)
Eric Snow [Mon, 28 Apr 2025 18:46:22 +0000 (12:46 -0600)] 
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__.

6 months agogh-132775: Add _PyModule_GetFilenameObject() and _PyModule_GetFilenameUTF8() (gh...
Eric Snow [Mon, 28 Apr 2025 18:41:32 +0000 (12:41 -0600)] 
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__.

6 months agogh-132742: Fix newly added tcflush() tests on Android (GH-133070)
Serhiy Storchaka [Mon, 28 Apr 2025 18:41:09 +0000 (21:41 +0300)] 
gh-132742: Fix newly added tcflush() tests on Android (GH-133070)

6 months agogh-132930: Improve the names of IDLE and PyDoc shortcuts (GH-133091)
Steve Dower [Mon, 28 Apr 2025 18:09:20 +0000 (19:09 +0100)] 
gh-132930: Improve the names of IDLE and PyDoc shortcuts (GH-133091)

6 months agoGH-128520: pathlib ABCs: raise text encoding warnings at correct stack level (#133051)
Barney Gale [Mon, 28 Apr 2025 18:04:20 +0000 (19:04 +0100)] 
GH-128520: pathlib ABCs: raise text encoding warnings at correct stack level (#133051)

Ensure that warnings about unspecified text encodings are emitted from
`ReadablePath.read_text()`, `WritablePath.write_text()` and `magic_open()`
with the correct stack level set.

6 months agogh-132775: Cleanup Related to crossinterp.c Before Further Changes (gh-132974)
Eric Snow [Mon, 28 Apr 2025 17:55:15 +0000 (11:55 -0600)] 
gh-132775: Cleanup Related to crossinterp.c Before Further Changes (gh-132974)

This change consists of adding tests and moving code around, with some renaming thrown in.

6 months agogh-133054: Skip `test_pyrepl` tests when `cannot use pyrepl` is reported (#133055)
sobolevn [Mon, 28 Apr 2025 16:09:28 +0000 (19:09 +0300)] 
gh-133054: Skip `test_pyrepl` tests when `cannot use pyrepl` is reported (#133055)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
6 months agogh-132952: Speed up startup by importing _io instead of io (#132957)
Jelle Zijlstra [Mon, 28 Apr 2025 15:38:56 +0000 (08:38 -0700)] 
gh-132952: Speed up startup by importing _io instead of io (#132957)

6 months agotyping, annotationlib: clean tests (#133087)
Jelle Zijlstra [Mon, 28 Apr 2025 15:38:11 +0000 (08:38 -0700)] 
typing, annotationlib: clean tests (#133087)

- Add @cpython_only decorator to lazy import tests
- Rename reference to SOURCE format
- Always two newlines between test case classes
- Merge two classes of ForwardRef tests
- Use get_annotations instead of annotationlib.get_annotations
- Format test_annotationlib with Black (not expecting that we'll keep this up
  but it's close to Black-formatted right now)

6 months agogh-129965: Add more missing MIME types (#132845)
Hugo van Kemenade [Mon, 28 Apr 2025 15:30:35 +0000 (18:30 +0300)] 
gh-129965: Add more missing MIME types (#132845)

6 months agogh-132915: Try to detect a buffer overflow in fcntl() and ioctl() (GH-132919)
Serhiy Storchaka [Mon, 28 Apr 2025 14:56:10 +0000 (17:56 +0300)] 
gh-132915: Try to detect a buffer overflow in fcntl() and ioctl() (GH-132919)

SystemError is raised when buffer overflow is detected.
The stack and memory can already be corrupted, so treat this error as fatal.

6 months agogh-132726: Change the heading of `sysconfig` CLI section (#133035)
Semyon Moroz [Mon, 28 Apr 2025 14:44:49 +0000 (18:44 +0400)] 
gh-132726: Change the heading of `sysconfig` CLI section (#133035)

6 months agogh-75223: Deprecate undotted extensions in `mimetypes.MimeTypes.add_type` (#128638)
Hugo van Kemenade [Mon, 28 Apr 2025 14:23:57 +0000 (17:23 +0300)] 
gh-75223: Deprecate undotted extensions in `mimetypes.MimeTypes.add_type` (#128638)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Daniel Watkins <daniel@daniel-watkins.co.uk>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
6 months agogh-132983: Convert compression._common to a package (#133086)
Victor Stinner [Mon, 28 Apr 2025 14:13:06 +0000 (16:13 +0200)] 
gh-132983: Convert compression._common to a package (#133086)

Add an "__init__.py" file. Fix test_tools.test_freeze.

6 months agogh-133073: avoid `NULL + 0` arithmetic in `list_extend_*` functions (#133074)
Bénédikt Tran [Mon, 28 Apr 2025 13:59:09 +0000 (15:59 +0200)] 
gh-133073: avoid `NULL + 0` arithmetic in `list_extend_*` functions (#133074)

6 months agogh-87135: Raise PythonFinalizationError when joining a blocked daemon thread (gh...
Petr Viktorin [Mon, 28 Apr 2025 13:48:48 +0000 (15:48 +0200)] 
gh-87135: Raise PythonFinalizationError when joining a blocked daemon thread (gh-130402)

If `Py_IsFinalizing()` is true, non-daemon threads (other than the current one)
are done, and daemon threads are prevented from running, so they
cannot finalize themselves and become done. Joining them (without timeout)
would block forever.

Raise PythonFinalizationError instead of hanging.

Raise even when a timeout is given, for consistency with trying to join your own thread.

See gh-123940 for a use case: calling `join()` from `__del__`. This is
ill-advised, but an exception should at least make it easier to diagnose.

6 months agoFixed a typo in the `PCbuild/readme.txt` about PGO clang-cl (#133083)
Wulian233 [Mon, 28 Apr 2025 13:39:16 +0000 (21:39 +0800)] 
Fixed a typo in the `PCbuild/readme.txt` about PGO clang-cl (#133083)

Fixed a typo in the readme.txt section about PGO clang-cl

6 months agogh-130317: Fix PyFloat_Pack/Unpack[24] for NaN's with payload (#130452)
Sergey B Kirpichev [Mon, 28 Apr 2025 13:23:26 +0000 (16:23 +0300)] 
gh-130317: Fix PyFloat_Pack/Unpack[24] for NaN's with payload (#130452)

Co-authored-by: Victor Stinner <vstinner@python.org>
6 months agogh-130907: Treat all module-level annotations as conditional (#131550)
Jelle Zijlstra [Mon, 28 Apr 2025 13:10:28 +0000 (06:10 -0700)] 
gh-130907: Treat all module-level annotations as conditional (#131550)

6 months agogh-53032: support IEEE 754 contexts in the decimal module (#122003)
Sergey B Kirpichev [Mon, 28 Apr 2025 13:05:56 +0000 (16:05 +0300)] 
gh-53032: support IEEE 754 contexts in the decimal module (#122003)

This was in C version from beginning, but available only
on conditional compilation (EXTRA_FUNCTIONALITY).  Current
patch adds function to create IEEE contexts to the
pure-python module as well.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
6 months agogh-132930: Implement PEP 773 (GH-132931)
Steve Dower [Mon, 28 Apr 2025 12:57:47 +0000 (13:57 +0100)] 
gh-132930: Implement PEP 773 (GH-132931)

This change to the core CPython repo:
* Adds PyManager support to PC/layout
* Adds a warning message to the legacy py.exe if subcommands are invoked
* Add deprecation message to traditional installer
* Updates using/windows docs

6 months agoGH-114911: use time.perf_counter in Stopwatch (GH-131469)
Chris Eibl [Mon, 28 Apr 2025 11:55:08 +0000 (13:55 +0200)] 
GH-114911: use time.perf_counter in Stopwatch (GH-131469)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
6 months agogh-131423: update note in `Tools/ssl/make_ssl_data.py` (#133077)
Bénédikt Tran [Mon, 28 Apr 2025 11:11:46 +0000 (13:11 +0200)] 
gh-131423: update note in `Tools/ssl/make_ssl_data.py` (#133077)

6 months agogh-111178: fix incorrect function signatures for Windows builds (#133072)
Bénédikt Tran [Mon, 28 Apr 2025 11:05:39 +0000 (13:05 +0200)] 
gh-111178: fix incorrect function signatures for Windows builds (#133072)