]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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)

6 months agogh-133033: Add docs for `TypeIgnore` (#133034)
Yuki Kobayashi [Mon, 28 Apr 2025 10:49:07 +0000 (19:49 +0900)] 
gh-133033: Add docs for `TypeIgnore` (#133034)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
6 months agogh-127604: ensure `-ldl` is passed only once to the linker (#133071)
Bénédikt Tran [Mon, 28 Apr 2025 09:55:02 +0000 (11:55 +0200)] 
gh-127604: ensure `-ldl` is passed only once to the linker (#133071)

6 months agogh-132987: Support __index__() for unsigned integers in Argument Clinic (GH-133011)
Serhiy Storchaka [Mon, 28 Apr 2025 08:02:18 +0000 (11:02 +0300)] 
gh-132987: Support __index__() for unsigned integers in Argument Clinic (GH-133011)

6 months agogh-132742: Improve tests for fcntl.ioctl() (GH-132791)
Serhiy Storchaka [Mon, 28 Apr 2025 07:42:40 +0000 (10:42 +0300)] 
gh-132742: Improve tests for fcntl.ioctl() (GH-132791)

* Use better tests for integer argument.
* Add also parallel tests for tcflush() and tcflow().

6 months agogh-132983: Install compression package contents (#133063)
Emma Smith [Mon, 28 Apr 2025 06:44:20 +0000 (23:44 -0700)] 
gh-132983: Install compression package contents (#133063)

Include compression package contents as part of installs.

6 months agogh-133061: do not mention `UINT32_MAX` in HMAC user-facing messages (#133062)
Bénédikt Tran [Sun, 27 Apr 2025 23:14:12 +0000 (01:14 +0200)] 
gh-133061: do not mention `UINT32_MAX` in HMAC user-facing messages (#133062)

6 months agoDocs: fix a couple typos in `Doc/` (GH-132927)
Yongzi Li [Sun, 27 Apr 2025 22:56:58 +0000 (06:56 +0800)] 
Docs: fix a couple typos in `Doc/` (GH-132927)

fix minor typos

6 months agogh-127604: ensure `-ldl` is passed to the linker when `dladdr1` is found (#133040)
Bénédikt Tran [Sun, 27 Apr 2025 22:28:42 +0000 (00:28 +0200)] 
gh-127604: ensure `-ldl` is passed to the linker when `dladdr1` is found (#133040)

6 months agogh-132993: expose `HASHLIB_GIL_MINSIZE` to private extension modules (#132999)
Bénédikt Tran [Sun, 27 Apr 2025 22:20:15 +0000 (00:20 +0200)] 
gh-132993: expose `HASHLIB_GIL_MINSIZE` to private extension modules (#132999)

6 months agogh-133005: Support `tarfile.open(mode="w|xz", preset=...)` (GH-133007)
Michał Górny [Sun, 27 Apr 2025 22:19:59 +0000 (00:19 +0200)] 
gh-133005: Support `tarfile.open(mode="w|xz", preset=...)` (GH-133007)

* gh-133005: Support `tarfile.open(mode="w|xz", preset=...)`

Support passing the `preset` option to `tarfile.open` when the file
is open with `mode="w|xz"`.  This aligns the behavior with `"w:xz"`
mode.

* Also raise an error for `compresslevel` or `preset` with wrong mode

Raise an error if `compresslevel` or `preset` argument is specified
for stream mode with incorrect compression. This should reduce the risk
of mistakes and align the stream modes with regular modes, that raise
an implicit TypeError on unsupported arguments.

* Apply suggestions from code review

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
6 months agoSilence system utils tests in emscripten python.sh (#133044)
Lukas [Sun, 27 Apr 2025 22:13:02 +0000 (00:13 +0200)] 
Silence system utils tests in emscripten python.sh (#133044)

Ensure that checks for system functions don't leak onto stdout on failure.

6 months agogh-132026: Ensure _MIPS_SIM has defined _ABI identifiers for comparison (GH-132027)
Valters Jansons [Sun, 27 Apr 2025 21:56:00 +0000 (00:56 +0300)] 
gh-132026: Ensure _MIPS_SIM has defined _ABI identifiers for comparison (GH-132027)

When built on a MIPS architecture, `_MIPS_SIM` is used to determine
architecture specifics. The value is expected to match either
`_ABIO32`, `_ABIN32` or `_ABI64`.

In `gcc` config/mips/mips.h these values are defined as compiler
`builtin_define` inside of a switch/case. That means, mips64el and
mips64 architectures know about `_ABI64` but don't know about `_ABIO32`
and `_ABIN32`. In turn, when CPython tries to use them in comparison,
they may be undefined identifiers.

In default compiler behavior, the undefined identifier will be
evaluated as zero, and it will not match `_MIPS_SIM`. However, the
issues pop up when `-Wundef` (or, even worse, `-Werror=undef`) compiler
flag is enabled. Then suddenly it's visible as a warning or error.

6 months agogh-132983: Introduce `compression` package and move `_compression` module (GH-133018)
Emma Smith [Sun, 27 Apr 2025 21:41:30 +0000 (14:41 -0700)] 
gh-132983: Introduce `compression` package and move `_compression` module (GH-133018)

* Introduces `compression` package for https://peps.python.org/pep-0784/

This commit introduces the `compression` package, specified in PEP 784
to re-export the `lzma`, `bz2`, `gzip`, and `zlib` modules. Introduction
of `compression.zstd` will be completed in a future commit once the
`_zstd` module is merged.

This commit also moves the `_compression` private module to
`compression._common._streams`.

* Re-exports existing module docstrings.

6 months agogh-133046: Reformat the ``ast`` module docstring (GH-133050)
Hunter Hogan [Sun, 27 Apr 2025 21:35:56 +0000 (16:35 -0500)] 
gh-133046: Reformat the ``ast`` module docstring (GH-133050)

* Fix formatting in module docstring for `ast` https://github.com/python/cpython/issues/133046
* #133046 ast docstring: remove header, dedent, 80-char width.
* Keep existing wrapping

---------

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
6 months agogh-115032: Deprecate support for custom logging handlers with 'strm' argument. (GH...
Mariusz Felisiak [Sun, 27 Apr 2025 21:18:14 +0000 (23:18 +0200)] 
gh-115032: Deprecate support for custom logging handlers with 'strm' argument. (GH-115314)

6 months ago[tests] fix test_fcntl issue when run in a ChromeOS linux runtime (GH-133053)
Gregory P. Smith [Sun, 27 Apr 2025 20:28:23 +0000 (13:28 -0700)] 
[tests] fix test_fcntl issue when run in a ChromeOS linux runtime (GH-133053)

* [tests] test_fcntl fails when run in a ChromeOS linux runtime container.

It doesn't appear to support F_NOTIFY? Detect the lack of that and skip the test.

6 months agogh-127495: Append to history file after every statement in PyREPL (GH-132294)
Sergey B Kirpichev [Sun, 27 Apr 2025 13:32:37 +0000 (16:32 +0300)] 
gh-127495: Append to history file after every statement in PyREPL (GH-132294)

6 months agogh-131798: JIT - Use `sym_new_type` instead of `sym_new_not_null` for _BUILD_STRING...
Nadeshiko Manju [Sun, 27 Apr 2025 12:30:28 +0000 (20:30 +0800)] 
gh-131798: JIT - Use `sym_new_type` instead of `sym_new_not_null` for _BUILD_STRING, _BUILD_SET (GH-132564)

Signed-off-by: Manjusaka <me@manjusaka.me>
6 months agogh-128438: Use `EnvironmentVarGuard` in `test_zoneinfo.py` (#131870)
Wulian233 [Sun, 27 Apr 2025 11:29:37 +0000 (19:29 +0800)] 
gh-128438: Use `EnvironmentVarGuard` in `test_zoneinfo.py` (#131870)

6 months agogh-91069: do not disable `sha3` in `test_hashlib` under UBSan (#133001)
Bénédikt Tran [Sun, 27 Apr 2025 09:51:00 +0000 (11:51 +0200)] 
gh-91069: do not disable `sha3` in `test_hashlib` under UBSan (#133001)

6 months agogh-124703: Set return code to 1 when aborting process from pdb (#133013)
Tian Gao [Sat, 26 Apr 2025 22:43:23 +0000 (15:43 -0700)] 
gh-124703: Set return code to 1 when aborting process from pdb (#133013)

6 months agogh-63882: Implement some `test_minidom` tests (#132879)
Stan Ulbrych [Sat, 26 Apr 2025 20:03:48 +0000 (21:03 +0100)] 
gh-63882: Implement some `test_minidom` tests (#132879)

Co-authored-by: Julian Gindi <julian@gindi.io>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
6 months agogh-133016: Fix a reference to removed `asyncio.futures.TimeoutError` (#133019)
John [Sat, 26 Apr 2025 18:57:08 +0000 (13:57 -0500)] 
gh-133016: Fix a reference to removed `asyncio.futures.TimeoutError` (#133019)

Just use the builtin `TimeoutError`, and remove the import of `futures`.

6 months agogh-131798: JIT: Propagate the result in `_BINARY_OP_SUBSCR_TUPLE_INT` (GH-133003)
Tomas R. [Sat, 26 Apr 2025 18:47:55 +0000 (20:47 +0200)] 
gh-131798: JIT: Propagate the result in `_BINARY_OP_SUBSCR_TUPLE_INT` (GH-133003)

6 months agogh-63882: Use `self.assert*` methods in `test_minidom` (#133000)
Stan Ulbrych [Sat, 26 Apr 2025 18:24:54 +0000 (19:24 +0100)] 
gh-63882: Use `self.assert*` methods in `test_minidom` (#133000)

6 months agogh-133006: Add subprocess check for remote pdb test (#133014)
Tian Gao [Sat, 26 Apr 2025 18:09:09 +0000 (11:09 -0700)] 
gh-133006: Add subprocess check for remote pdb test (#133014)

6 months agogh-132991: Add socket.IP_FREEBIND constant (GH-132998)
Alyssa Ross [Sat, 26 Apr 2025 17:54:12 +0000 (19:54 +0200)] 
gh-132991: Add socket.IP_FREEBIND constant (GH-132998)

6 months agogh-131298: update `Modules/Setup` after HACL* static linking changes (#133012)
Anthony Sottile [Sat, 26 Apr 2025 16:44:19 +0000 (12:44 -0400)] 
gh-131298: update `Modules/Setup` after HACL* static linking changes (#133012)

This was overlooked in 5f2ba152a0471f6f556ca2d9486e5ba486fcfbde.

6 months agogh-132987: Support __index__() for "k" and "K" formats in PyArg_Parse (GH-132988)
Serhiy Storchaka [Sat, 26 Apr 2025 14:14:18 +0000 (17:14 +0300)] 
gh-132987: Support __index__() for "k" and "K" formats in PyArg_Parse (GH-132988)

6 months agogh-132388: remove outdated TODO comment in `test_hmac.py` (#133008)
Bénédikt Tran [Sat, 26 Apr 2025 13:17:03 +0000 (15:17 +0200)] 
gh-132388: remove outdated TODO comment in `test_hmac.py` (#133008)

6 months agogh-91221: fix `test_curses.test_use_default_colors` for xterm-256color (#132990)
Bénédikt Tran [Sat, 26 Apr 2025 10:38:27 +0000 (12:38 +0200)] 
gh-91221: fix `test_curses.test_use_default_colors` for xterm-256color (#132990)

Terminals with `xterm-256color` Xterm support may use 15 (bright white) as their default foreground color.

6 months agogh-132781: fix refleaks in `crossinterp_exceptions.h` post gh-132782 (#132989)
Bénédikt Tran [Sat, 26 Apr 2025 10:14:14 +0000 (12:14 +0200)] 
gh-132781: fix refleaks in `crossinterp_exceptions.h` post gh-132782 (#132989)

6 months agogh-132781: Make NotShareableError a TypeError Subclass (gh-132973)
Eric Snow [Fri, 25 Apr 2025 21:10:43 +0000 (15:10 -0600)] 
gh-132781: Make NotShareableError a TypeError Subclass (gh-132973)

It was a subclass of ValueError. However, shareability is a feature of types, not values.

6 months agogh-132781: Cleanup Code Related to NotShareableError (gh-132782)
Eric Snow [Fri, 25 Apr 2025 20:43:38 +0000 (14:43 -0600)] 
gh-132781: Cleanup Code Related to NotShareableError (gh-132782)

The following are added to the internal C-API:

* _PyErr_FormatV()
* _PyErr_SetModuleNotFoundError()
* _PyXIData_GetNotShareableErrorType()
* _PyXIData_FormatNotShareableError()

We also drop _PyXIData_lookup_context_t and _PyXIData_GetLookupContext().

6 months agogh-131798: JIT: Narrow the return type of _CALL_LEN to int (#132940)
Diego Russo [Fri, 25 Apr 2025 18:57:42 +0000 (19:57 +0100)] 
gh-131798: JIT: Narrow the return type of _CALL_LEN to int (#132940)

Reduce unnecessary guards whenever `len()` is called and used
after.

Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
6 months agogh-132950: Log is_remote_debug_enabled() in pythoninfo (#132965)
Victor Stinner [Fri, 25 Apr 2025 18:13:47 +0000 (20:13 +0200)] 
gh-132950: Log is_remote_debug_enabled() in pythoninfo (#132965)

 Log also the Py_REMOTE_DEBUG macro.

6 months agogh-91048: Prevent optimizing away the asyncio debug offsets structure on Windows...
Pablo Galindo Salgado [Fri, 25 Apr 2025 17:43:32 +0000 (18:43 +0100)] 
gh-91048: Prevent optimizing away the asyncio debug offsets structure on Windows (#132963)

To avoid having the debug sections being optimised away by the compiler
we use  __attribute__((used)) on gcc and clang but in Windows this is
not supported by the Microsoft compiler and there is no equivalent flag.
Unfortunately Windows offers almost no alternative other than exporting
the symbol in the dynamic table or using it somehow.

6 months agogh-132912: Use readline to synchronize between procs in remote pdb test (#132949)
Tian Gao [Fri, 25 Apr 2025 17:40:18 +0000 (10:40 -0700)] 
gh-132912: Use readline to synchronize between procs in remote pdb test (#132949)

6 months agogh-132950: Skip test_remote_pdb if remote exec is disabled (#132951)
Victor Stinner [Fri, 25 Apr 2025 17:28:25 +0000 (19:28 +0200)] 
gh-132950: Skip test_remote_pdb if remote exec is disabled (#132951)

6 months agogh-132776: Revert Moving memoryview XIData Code to memoryobject.c (gh-132960)
Eric Snow [Fri, 25 Apr 2025 16:43:50 +0000 (10:43 -0600)] 
gh-132776: Revert Moving memoryview XIData Code to memoryobject.c (gh-132960)

This is a partial revert of gh-132821.  It resolves the refleak introduced by that PR.

6 months agogh-132950: Check for Py_SUPPORTS_REMOTE_DEBUG in sys.is_remote_debug_enabled (#132959)
Pablo Galindo Salgado [Fri, 25 Apr 2025 16:38:48 +0000 (17:38 +0100)] 
gh-132950: Check for Py_SUPPORTS_REMOTE_DEBUG in sys.is_remote_debug_enabled (#132959)

6 months agogh-107954: Add audit event to PyConfig_Set() (#132958)
Victor Stinner [Fri, 25 Apr 2025 16:30:39 +0000 (18:30 +0200)] 
gh-107954: Add audit event to PyConfig_Set() (#132958)

6 months agogh-107954: Allow setting cpu_count in PyConfig_Set() (#132954)
Victor Stinner [Fri, 25 Apr 2025 16:29:55 +0000 (18:29 +0200)] 
gh-107954: Allow setting cpu_count in PyConfig_Set() (#132954)

* gh-107954: Allow setting cpu_count in PyConfig_Set()

* Update the doc

6 months agogh-91048: Fix _testexternalinspection.c on FreeBSD (#132945)
Victor Stinner [Fri, 25 Apr 2025 14:57:01 +0000 (16:57 +0200)] 
gh-91048: Fix _testexternalinspection.c on FreeBSD (#132945)