]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
5 months agogh-134664: document `cleanup_socket` parameter in `asyncio.start_unix_server` (#134750)
Shamil [Tue, 27 May 2025 08:23:06 +0000 (11:23 +0300)] 
gh-134664: document `cleanup_socket` parameter in `asyncio.start_unix_server` (#134750)

5 months agogh-134583: Update devcontainer reference to include image with libzstd-devel (gh...
Emma Smith [Tue, 27 May 2025 01:24:38 +0000 (18:24 -0700)] 
gh-134583: Update devcontainer reference to include image with libzstd-devel (gh-134765)

Update devcontainer reference

5 months agogh-134160: Use multi-phase init in documentation examples (#134296)
neonene [Mon, 26 May 2025 21:43:35 +0000 (06:43 +0900)] 
gh-134160: Use multi-phase init in documentation examples (#134296)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
5 months agogh-134637: Fix performance regression in calling `ctypes` function pointer in `free...
Kumar Aditya [Mon, 26 May 2025 18:26:40 +0000 (23:56 +0530)] 
gh-134637: Fix performance regression in calling `ctypes` function pointer in `free threading`. (#134702)

Fix performance regression in calling `ctypes` function pointer in `free threading`.

5 months agogh-132775: Unrevert "Use _PyCode GetScriptXIData()" (gh-134735)
Eric Snow [Mon, 26 May 2025 17:50:10 +0000 (11:50 -0600)] 
gh-132775: Unrevert "Use _PyCode GetScriptXIData()" (gh-134735)

This reverts commit 8a793c4a365d06a7264887698ccd7d6ba6aba9f2, AKA gh-134599.

This effectively re-applies commit 09e72cf (gh-134511)

5 months agogh-134675: Add t-string prefixes to tokenizer module, lexical analysis doc, and add...
Eric V. Smith [Mon, 26 May 2025 17:49:39 +0000 (13:49 -0400)] 
gh-134675: Add t-string prefixes to tokenizer module, lexical analysis doc, and add a test to make sure we catch this error in the future. (#134734)

* Add t-string prefixes to _all_string_prefixes, and add a test to make sure we catch this error in the future.

* Update lexical analysis docs for t-string prefixes.

5 months agogh-134557: Suppress immortalization in _PyCode_GetScriptXIData under free-threading...
neonene [Mon, 26 May 2025 17:46:49 +0000 (02:46 +0900)] 
gh-134557: Suppress immortalization in _PyCode_GetScriptXIData under free-threading (gh-134686)

Disable immortalization around Py_CompileString*().

The same approach as 332356b that fixed the refleaks in compile() and eval().

E: 09e72cf can pass test_capi, test_sys and test__interpchannels with this patch for me.

5 months agoAdd CODEOWNERS and YAML to end-of-file-fixer and trailing-whitespace (#134730)
Hugo van Kemenade [Mon, 26 May 2025 17:42:38 +0000 (20:42 +0300)] 
Add CODEOWNERS and YAML to end-of-file-fixer and trailing-whitespace (#134730)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
5 months agogh-119180: Updates to PEP 649/749 docs (#134640)
Jelle Zijlstra [Mon, 26 May 2025 15:35:04 +0000 (08:35 -0700)] 
gh-119180: Updates to PEP 649/749 docs (#134640)

- Mention (again) that `type.__annotations__` is unsafe. It is now safe
  when using only classes defined under PEP 649 semantics, but not with
  classes defined using `from __future__ import annotations`.
- Mention that annotations on instances no longer work. There was already
  an issue about this.
- Mention the general changes in the "Porting to Python 3.14" section.
- `annotationlib` was proposed by PEP-749, not PEP-649.

Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
5 months agogh-134693: Fix `[-Wmaybe-uninitialized]` warning in `_remote_debugging_module.c`...
sobolevn [Mon, 26 May 2025 15:06:33 +0000 (18:06 +0300)] 
gh-134693: Fix `[-Wmaybe-uninitialized]` warning in `_remote_debugging_module.c` (#134694)

5 months agogh-132983: Convert dict_content to take Py_buffer in ``ZstdDict()`` (#133924)
Adam Turner [Mon, 26 May 2025 14:48:41 +0000 (15:48 +0100)] 
gh-132983: Convert dict_content to take Py_buffer in ``ZstdDict()`` (#133924)

5 months agoAdd trailing line to CODEOWNERS (#134722)
Pablo Galindo Salgado [Mon, 26 May 2025 14:47:09 +0000 (15:47 +0100)] 
Add trailing line to CODEOWNERS (#134722)

5 months agoAdd CODEOWNERS for remote debugging (#134720)
Pablo Galindo Salgado [Mon, 26 May 2025 14:36:30 +0000 (15:36 +0100)] 
Add CODEOWNERS for remote debugging (#134720)

5 months agogh-91048: Add better error messages for remote debugging for CI builds (#134682)
Pablo Galindo Salgado [Mon, 26 May 2025 14:31:47 +0000 (15:31 +0100)] 
gh-91048: Add better error messages for remote debugging for CI builds (#134682)

5 months agogh-91048: Correct Apple platform includes for iOS. (#134712)
Russell Keith-Magee [Mon, 26 May 2025 12:44:41 +0000 (20:44 +0800)] 
gh-91048: Correct Apple platform includes for iOS. (#134712)

Correct Apple platform includes for iOS.

5 months agogh-132710: add missing NEWS entry for GH-132901 (#134705)
Bénédikt Tran [Mon, 26 May 2025 10:38:16 +0000 (12:38 +0200)] 
gh-132710: add missing NEWS entry for GH-132901 (#134705)

5 months agogh-134531: cleanup `_hashopenssl.c` to support `EVP_MAC` (#134626)
Bénédikt Tran [Mon, 26 May 2025 10:12:32 +0000 (12:12 +0200)] 
gh-134531: cleanup `_hashopenssl.c` to support `EVP_MAC` (#134626)

Rename components related to `_hashlib.{HASH,HASHXOF}` objects.

- The `EVPobject` structure is renamed `HASHobject`.
- Non-clinic `HASH` methods are now prefixed by `_hashlib_HASH_*`.
  A similar change is made for non-clinic `HASHXOF` methods.
- Functions extracting information from `EVP_MD` objects and functions
  constructing `EVP_MD` objects now include `openssl_evp_md` in their name.

This change allows us to avoid future ambiguities between the `EVP_MD`
and the `EVP_MAC` APIs (currently, we only use `EVP_MD` for hash functions
and rely on the legacy interface for HMAC instead of using `EVP_MAC`).

5 months agogh-134559: Add versionadded for ``object.__replace__()`` (#134672)
tmlnv [Mon, 26 May 2025 09:39:04 +0000 (12:39 +0300)] 
gh-134559: Add versionadded for ``object.__replace__()`` (#134672)

5 months agogh-132710: only use stable `_uuid.generate_time_safe()` to deduce MAC address (#132901)
Bénédikt Tran [Mon, 26 May 2025 08:56:31 +0000 (10:56 +0200)] 
gh-132710: only use stable `_uuid.generate_time_safe()` to deduce MAC address (#132901)

5 months agogh-134208: remove dead AC directives for `_curses.window.{chgat,getstr,instr}` (...
Bénédikt Tran [Mon, 26 May 2025 08:52:19 +0000 (10:52 +0200)] 
gh-134208: remove dead AC directives for `_curses.window.{chgat,getstr,instr}` (#134325)

5 months agogh-129594: Remove redundant check on varargs in `_PyArg_CheckPositional` (#129595)
Pieter Eendebak [Mon, 26 May 2025 08:51:12 +0000 (10:51 +0200)] 
gh-129594: Remove redundant check on varargs in `_PyArg_CheckPositional` (#129595)

5 months agogh-132876: workaround broken ldexp() on Windows 10 (#133135)
Sergey B Kirpichev [Mon, 26 May 2025 02:44:33 +0000 (05:44 +0300)] 
gh-132876: workaround broken ldexp() on Windows 10 (#133135)

* gh-132876: workaround broken ldexp() on Windows 10

ldexp() fails to round subnormal results before Windows 11,
so hide their bug.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
5 months agogh-69605: Disable PyREPL module autocomplete fallback on regular completion (gh-134181)
Loïc Simon [Sun, 25 May 2025 23:05:08 +0000 (01:05 +0200)] 
gh-69605: Disable PyREPL module autocomplete fallback on regular completion (gh-134181)

Co-authored-by: Loïc Simon <loic.simon@napta.io>
5 months agogh-134152: Fix UnboundLocalError in email._header_value_parser _get_ptext_to_endchars...
R. David Murray [Sun, 25 May 2025 22:09:32 +0000 (18:09 -0400)] 
gh-134152: Fix UnboundLocalError in email._header_value_parser _get_ptext_to_endchars (#134233)

Fix an UnboundLocalError that can occur when parsing certain delimited constructs in headers (domain literals, quoted strings, comments). After the fix the _get_ptext_to_endchars returns an empty string if there is no content after the opening delimiter. The calling code is responsible for handling the lack of the trailing delimiter, which it already does; this edge case was the header ending immediately after the opening delimiter.

5 months agoHeavily comment Python/perf_jit_trampoline.c to improve maintainability (#134527)
Pablo Galindo Salgado [Sun, 25 May 2025 20:37:15 +0000 (21:37 +0100)] 
Heavily comment Python/perf_jit_trampoline.c to improve maintainability (#134527)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
5 months agogh-91048: Refactor and optimize remote debugging module (#134652)
Pablo Galindo Salgado [Sun, 25 May 2025 20:19:29 +0000 (21:19 +0100)] 
gh-91048: Refactor and optimize remote debugging module (#134652)

Completely refactor Modules/_remote_debugging_module.c with improved
code organization, replacing scattered reference counting and error
handling with centralized goto error paths. This cleanup improves
maintainability and reduces code duplication throughout the module while
preserving the same external API.

Implement memory page caching optimization in Python/remote_debug.h to
avoid repeated reads of the same memory regions during debugging
operations. The cache stores previously read memory pages and reuses
them for subsequent reads, significantly reducing system calls and
improving performance.

Add code object caching mechanism with a new code_object_generation
field in the interpreter state that tracks when code object caches need
invalidation. This allows efficient reuse of parsed code object metadata
and eliminates redundant processing of the same code objects across
debugging sessions.

Optimize memory operations by replacing multiple individual structure
copies with single bulk reads for the same data structures. This reduces
the number of memory operations and system calls required to gather
debugging information from the target process.

Update Makefile.pre.in to include Python/remote_debug.h in the headers
list, ensuring that changes to the remote debugging header force proper
recompilation of dependent modules and maintain build consistency across
the codebase.

Also, make the module compatible with the free threading build as an extra :)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
5 months agogh-134357: Remove unused imports in tests (#134340)
Hugo van Kemenade [Sun, 25 May 2025 20:09:02 +0000 (23:09 +0300)] 
gh-134357: Remove unused imports in tests (#134340)

5 months agoFix sphinx-lint warnings (default-role used). (GH-134647)
Julien Palard [Sun, 25 May 2025 19:22:52 +0000 (21:22 +0200)] 
Fix sphinx-lint warnings (default-role used). (GH-134647)

5 months agoGH-130328: Fix WindowsConsoleGetEventTests after gh-133728 (gh-134660)
Chris Eibl [Sun, 25 May 2025 18:17:13 +0000 (20:17 +0200)] 
GH-130328: Fix WindowsConsoleGetEventTests after gh-133728 (gh-134660)

5 months agogh-133960: Improve typing.evaluate_forward_ref (#133961)
Jelle Zijlstra [Sun, 25 May 2025 17:26:39 +0000 (10:26 -0700)] 
gh-133960: Improve typing.evaluate_forward_ref (#133961)

As explained in #133960, this removes most of the behavior differences with ForwardRef.evaluate.
The remaining difference is about recursive evaluation of forwardrefs; this is practically useful
in cases where an annotation refers to a type alias that itself is string-valued.

This also improves several edge cases that were previously not handled optimally. For example,
the function now takes advantage of the partial evaluation behavior of ForwardRef.evaluate() to
evaluate more ForwardRefs in the FORWARDREF format.

This also fixes #133959 as a side effect, because the buggy behavior in #133959 derives from
evaluate_forward_ref().

5 months agoannotationlib docs: note that ForwardRef.evaluate eventually defaults to empty global...
Jelle Zijlstra [Sun, 25 May 2025 17:23:28 +0000 (10:23 -0700)] 
annotationlib docs: note that ForwardRef.evaluate eventually defaults to empty globals (#134661)

5 months agogh-134582: Fix t-strings untokenize() roundtrip removing space between braces (#134603)
Loïc Simon [Sun, 25 May 2025 16:23:38 +0000 (18:23 +0200)] 
gh-134582: Fix t-strings untokenize() roundtrip removing space between braces (#134603)

5 months agogh-133684: Fix get_annotations() where PEP 563 is involved (#133795)
Jelle Zijlstra [Sun, 25 May 2025 15:40:58 +0000 (08:40 -0700)] 
gh-133684: Fix get_annotations() where PEP 563 is involved (#133795)

5 months agogh-133778: Fix setting `__annotations__` under PEP 563 (#133794)
Jelle Zijlstra [Sun, 25 May 2025 15:38:18 +0000 (08:38 -0700)] 
gh-133778: Fix setting `__annotations__` under PEP 563 (#133794)

5 months agoGH-130328: Speedup pasting in legacy console on Windows (gh-133728)
Chris Eibl [Sun, 25 May 2025 13:17:43 +0000 (15:17 +0200)] 
GH-130328: Speedup pasting in legacy console on Windows (gh-133728)

5 months agogh-134168: fix `http.server` CLI support for IPv6 and `--directory` when serving...
ggqlq [Sat, 24 May 2025 12:19:20 +0000 (20:19 +0800)] 
gh-134168: fix `http.server` CLI support for IPv6 and `--directory` when serving over HTTPS (#134169)

5 months agogh-131178: add E2E mockless tests for `http.server` command-line interface (#134279)
Bénédikt Tran [Sat, 24 May 2025 11:48:50 +0000 (13:48 +0200)] 
gh-131178: add E2E mockless tests for `http.server` command-line interface (#134279)

5 months agogh-134595: Update HOWTO to reflect change in CIBW option (#134598)
Jasper Wong [Sat, 24 May 2025 07:15:00 +0000 (08:15 +0100)] 
gh-134595: Update HOWTO to reflect change in CIBW option (#134598)

5 months agogh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462)
Eddy Mulyono [Sat, 24 May 2025 03:50:19 +0000 (23:50 -0400)] 
gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462)

Doc/library/multiprocessing.rst: freeze_support: Change to specify spawn method instead of platform
Have multiprocessing.freeze_support() enable on spawn, not just win32.

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
5 months agogh-134546: ensure remote pdb script is readable (#134552)
Anthony Sottile [Sat, 24 May 2025 03:07:39 +0000 (23:07 -0400)] 
gh-134546: ensure remote pdb script is readable (#134552)

5 months agogh-128840: Limit the number of parts in IPv6 address parsing (GH-128841)
Seth Michael Larson [Sat, 24 May 2025 02:57:13 +0000 (21:57 -0500)] 
gh-128840: Limit the number of parts in IPv6 address parsing (GH-128841)

GH-128840: Limit the number of parts in IPv6 address parsing
Limit length of IP address string to 39

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
5 months agogh-132983: Make _zstd C code PEP 7 compliant (GH-134605)
Emma Smith [Sat, 24 May 2025 02:03:21 +0000 (19:03 -0700)] 
gh-132983: Make _zstd C code PEP 7 compliant (GH-134605)

Make _zstd C code PEP 7 compliant

5 months agogh-132983: Slightly tweak error messages for _zstd compressor/decompressor options...
Emma Smith [Fri, 23 May 2025 21:51:41 +0000 (14:51 -0700)] 
gh-132983: Slightly tweak error messages for _zstd compressor/decompressor options dict (#134601)

Slightly tweak error messages for options dict

5 months agogh-134557: Revert "gh-132775: Use _PyCode GetScriptXIData()" (gh-134599)
Eric Snow [Fri, 23 May 2025 20:04:20 +0000 (14:04 -0600)] 
gh-134557: Revert "gh-132775: Use _PyCode GetScriptXIData()" (gh-134599)

This reverts commit 09e72cf091d, AKA gh-134511.

We are reverting due to refleaks on free-threaded builds.

5 months agogh-134381: Fix RuntimeError when starting not-yet started Thread after fork (gh-134514)
Jiucheng(Oliver) [Fri, 23 May 2025 19:22:14 +0000 (15:22 -0400)] 
gh-134381: Fix RuntimeError when starting not-yet started Thread after fork (gh-134514)

5 months agogh-120170: Exclude __mp_main__ in C version of whichmodule() (#120171)
Daniel Li [Fri, 23 May 2025 18:45:45 +0000 (14:45 -0400)] 
gh-120170: Exclude __mp_main__ in C version of whichmodule() (#120171)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
5 months agogh-134565: Use ExceptionGroup to handle multiple errors in unittest.doModuleCleanups...
Serhiy Storchaka [Fri, 23 May 2025 18:07:49 +0000 (21:07 +0300)] 
gh-134565: Use ExceptionGroup to handle multiple errors in unittest.doModuleCleanups() (GH-134566)

5 months agogh-134578: Mark more slow tests (GH-134579)
Serhiy Storchaka [Fri, 23 May 2025 16:59:10 +0000 (19:59 +0300)] 
gh-134578: Mark more slow tests (GH-134579)

5 months agogh-133454: Reduce the number of threads in test_racing_getbuf_and_releasebuf (GH...
Serhiy Storchaka [Fri, 23 May 2025 16:58:34 +0000 (19:58 +0300)] 
gh-133454: Reduce the number of threads in test_racing_getbuf_and_releasebuf (GH-133458)

The original reproducer only used 10 threads.

5 months agogh-131798: Small improvements to `remove_unneeded_uops` (GH-134554)
Tomas R. [Fri, 23 May 2025 12:48:45 +0000 (08:48 -0400)] 
gh-131798: Small improvements to `remove_unneeded_uops` (GH-134554)

Improve remove_unneeded_uops

5 months agogh-134486: Fix missing alloca() symbol in _ctypes on NetBSD (#134487)
Collin Funk [Fri, 23 May 2025 11:11:04 +0000 (04:11 -0700)] 
gh-134486: Fix missing alloca() symbol in _ctypes on NetBSD (#134487)

Previously the module would fail to load because the `alloca()` symbol
was undefined. Now we check for GCC/Clang builtins for systems who do
not define `alloca()` in headers.

5 months agoFurther improves Advanced installation docs for PyManager (GH-134541)
Steve Dower [Fri, 23 May 2025 10:17:18 +0000 (11:17 +0100)] 
Further improves Advanced installation docs for PyManager (GH-134541)

5 months agogh-106318: Add example for `str.count()` (#134519)
Blaise Pabon [Fri, 23 May 2025 09:47:11 +0000 (05:47 -0400)] 
gh-106318: Add example for `str.count()` (#134519)

5 months agogh-106318: Add example for `str.center()` (#134518)
Blaise Pabon [Fri, 23 May 2025 09:44:15 +0000 (05:44 -0400)] 
gh-106318: Add example for `str.center()` (#134518)

5 months agogh-133372: remove out of date todos from types module about generator wrapper (#134563)
Kumar Aditya [Fri, 23 May 2025 05:19:41 +0000 (10:49 +0530)] 
gh-133372: remove out of date todos from types module about generator wrapper (#134563)

5 months agogh-134451: Converted `asyncio.tools.CycleFoundException` from dataclass to a regular...
Evgeny Demchenko [Fri, 23 May 2025 05:15:21 +0000 (08:15 +0300)] 
gh-134451: Converted `asyncio.tools.CycleFoundException` from dataclass to a regular exception type. (#134513)

5 months agogh-114177: avoid calling connection lost callbacks when loop is already closed in...
Kumar Aditya [Fri, 23 May 2025 04:33:16 +0000 (10:03 +0530)] 
gh-114177: avoid calling connection lost callbacks when loop is already closed in asyncio subprocess (#134508)

5 months agogh-133885: Use locks instead of critical sections for _zstd (gh-134289)
Emma Smith [Fri, 23 May 2025 03:30:10 +0000 (20:30 -0700)] 
gh-133885: Use locks instead of critical sections for _zstd (gh-134289)

Move from using critical sections to locks for the (de)compression methods.
Since the methods allow other threads to run, we should use a lock rather
than a critical section.

5 months agoDocs: fix link in free-threading-python.rst (#134548)
Cheery [Fri, 23 May 2025 00:37:20 +0000 (01:37 +0100)] 
Docs: fix link in free-threading-python.rst (#134548)

5 months agogh-128307: Update docs for asyncio.create_task, TaskGroup.create_task, asyncio.create...
Thomas Grainger [Thu, 22 May 2025 22:54:56 +0000 (23:54 +0100)] 
gh-128307: Update docs for asyncio.create_task, TaskGroup.create_task, asyncio.create_task (#134202)

5 months agoGH-131769: fix detecting a pydebug build of the build Python when building for WASI...
Brett Cannon [Thu, 22 May 2025 21:41:50 +0000 (14:41 -0700)] 
GH-131769: fix detecting a pydebug build of the build Python when building for WASI (GH-134015)

5 months agoAvoid `__file__` in `hashlib` example (GH-134540)
Josh Cannon [Thu, 22 May 2025 21:32:00 +0000 (16:32 -0500)] 
Avoid `__file__` in `hashlib` example (GH-134540)

5 months agoGH-130397: remove special-casing of C stack depth for WASI (#134469)
Brett Cannon [Thu, 22 May 2025 21:08:44 +0000 (14:08 -0700)] 
GH-130397: remove special-casing of C stack depth for WASI (#134469)

Removed special-casing for WASI when setting C stack depth limits. Since WASI has its own C stack checking this isn't a security risk.

Also disabled some tests that stopped passing. They all happened to have already been disabled under Emscripten.

5 months agoDocs: Add note to tutorial clarifying scope (#134534)
Kattni [Thu, 22 May 2025 18:26:47 +0000 (14:26 -0400)] 
Docs: Add note to tutorial clarifying scope (#134534)

* Add note to tutorial

* Update formatting

5 months agoGH-131798: Optimize away isinstance calls in the JIT (GH-134369)
Tomas R. [Thu, 22 May 2025 18:05:43 +0000 (14:05 -0400)] 
GH-131798: Optimize away isinstance calls in the JIT (GH-134369)

5 months agogh-132775: Fix Recently Introduced Warnings (gh-134530)
Eric Snow [Thu, 22 May 2025 17:24:09 +0000 (11:24 -0600)] 
gh-132775: Fix Recently Introduced Warnings (gh-134530)

5 months agoGH-131798: Optimize away isinstance calls in the JIT (GH-134369)
Tomas R. [Thu, 22 May 2025 16:52:47 +0000 (12:52 -0400)] 
GH-131798: Optimize away isinstance calls in the JIT (GH-134369)

5 months agogh-134322: Fix `repr(threading.RLock)` (#134389)
Duprat [Thu, 22 May 2025 16:46:57 +0000 (18:46 +0200)] 
gh-134322: Fix `repr(threading.RLock)` (#134389)

Fix the `__repr__` value of `threading.RLock` from `_thread` module, when just created.

5 months agogh-132775: Make _PyXI_session Opaque (gh-134452)
Eric Snow [Thu, 22 May 2025 16:14:04 +0000 (10:14 -0600)] 
gh-132775: Make _PyXI_session Opaque (gh-134452)

This is mostly a refactor to clean things up a bit, most notably the "XI namespace" code.

Making the session opaque requires adding the following internal-only functions:

* _PyXI_NewSession()
* _PyXI_FreeSession()
* _PyXI_GetMainNamespace()

5 months agoGH-131798: Optimize cached class attributes and methods in the JIT (GH-134403)
Brandt Bucher [Thu, 22 May 2025 15:15:03 +0000 (11:15 -0400)] 
GH-131798: Optimize cached class attributes and methods in the JIT (GH-134403)

5 months agogh-132775: Use _PyCode GetScriptXIData() (gh-134511)
Eric Snow [Thu, 22 May 2025 14:40:33 +0000 (08:40 -0600)] 
gh-132775: Use _PyCode GetScriptXIData() (gh-134511)

5 months agogh-133740: Fix locale.nl_langinfo(ALT_DIGITS) (#134468)
Victor Stinner [Thu, 22 May 2025 14:05:07 +0000 (16:05 +0200)] 
gh-133740: Fix locale.nl_langinfo(ALT_DIGITS) (#134468)

Set the LC_CTYPE locale to the LC_TIME locale even if
nl_langinfo(ALT_DIGITS) result is ASCII. The result is a list
separated by NUL characters and the code only checks the first list
item which can be ASCII whereas following items are non-ASCII.

Fix test__locale for the uk_UA locale on RHEL 7.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
5 months agoGH-131798: Turn _LOAD_SMALL_INT into _LOAD_CONST_INLINE_BORROW in the JIT (GH-134406)
Nadeshiko Manju [Thu, 22 May 2025 13:54:57 +0000 (21:54 +0800)] 
GH-131798: Turn _LOAD_SMALL_INT into _LOAD_CONST_INLINE_BORROW in the JIT (GH-134406)

5 months agogh-134323: Fix the new `threading.RLock.locked` method (#134368)
Duprat [Thu, 22 May 2025 13:48:24 +0000 (15:48 +0200)] 
gh-134323: Fix the new `threading.RLock.locked` method (#134368)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
5 months agogh-134370: Added clarification on instance annotations (#134387)
Alex Kautz [Thu, 22 May 2025 13:46:29 +0000 (09:46 -0400)] 
gh-134370: Added clarification on instance annotations (#134387)

Instances of classes cannot have annotations,
however sometimes they will erroneously have the
__annotations__ attribute

5 months agogh-132775: Use _PyObject_GetXIData (With Fallback) (gh-134440)
Eric Snow [Thu, 22 May 2025 12:50:06 +0000 (06:50 -0600)] 
gh-132775: Use _PyObject_GetXIData (With Fallback) (gh-134440)

This change includes some semi-related refactoring of queues and channels.

5 months agogh-134455: Fix `build-details.json` to use the ``c_api.headers`` key (#134456)
Michał Górny [Thu, 22 May 2025 11:28:35 +0000 (13:28 +0200)] 
gh-134455: Fix `build-details.json` to use the ``c_api.headers`` key (#134456)

Fix `build-details.json` generation to use the correct `c_api.headers`
key as defined in PEP 739, instead of `c_api.include`.

Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
5 months agogh-127081: lock non-re-entrant `*pwent` calls in free-threading (#132748)
Duane Griffin [Thu, 22 May 2025 10:22:02 +0000 (22:22 +1200)] 
gh-127081: lock non-re-entrant `*pwent` calls in free-threading (#132748)

5 months agogh-71339: Use new assertion methods in tests (GH-129046)
Serhiy Storchaka [Thu, 22 May 2025 10:17:22 +0000 (13:17 +0300)] 
gh-71339: Use new assertion methods in tests (GH-129046)

5 months agoConsistent sentence case in docs template files (#134412)
Hugo van Kemenade [Thu, 22 May 2025 09:51:02 +0000 (12:51 +0300)] 
Consistent sentence case in docs template files (#134412)

5 months agoGH-131688: Mark instructions and uops with DECREF_INPUTS as escaping. (GH-133501)
Mark Shannon [Thu, 22 May 2025 08:54:35 +0000 (09:54 +0100)] 
GH-131688: Mark instructions and uops with DECREF_INPUTS as escaping. (GH-133501)

5 months agoGH-133932: Tagged ints are heap safe (GH-134244)
Mark Shannon [Thu, 22 May 2025 08:54:04 +0000 (09:54 +0100)] 
GH-133932: Tagged ints are heap safe (GH-134244)

5 months agoAdd notes on nogil & reinitialization to the Opt-Out section in Module Isolation...
Petr Viktorin [Thu, 22 May 2025 07:36:37 +0000 (09:36 +0200)] 
Add notes on nogil & reinitialization to the Opt-Out section in Module Isolation HOWTO (GH-134141)

Co-authored-by: Sam Gross <colesbury@gmail.com>
5 months agogh-131357: Add some extra tests for empty bytes and bytearray (#134458)
Sergey Miryanov [Thu, 22 May 2025 07:01:46 +0000 (00:01 -0700)] 
gh-131357: Add some extra tests for empty bytes and bytearray (#134458)

5 months agogh-134309: Add ``github.actor`` to the GitHub Actions concurrency key (#134310)
Kira [Thu, 22 May 2025 03:49:07 +0000 (23:49 -0400)] 
gh-134309: Add ``github.actor`` to the GitHub Actions concurrency key (#134310)

When inexperienced users create a PR from their default branch, all of the concurrency keys
collide as there is no namespacing. This becomes an issue at events with many new contributors,
where workflow runs are cancelled on other pull requests.
Disambiguate by adding the username of the relevant 'actor' to the concurrency key.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Sviatoslav Sydorenko <sviat@redhat.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
5 months agogh-127840: Revert "gh-127840: pass flags and address from send_fds (GH-127841)" ...
Gregory P. Smith [Thu, 22 May 2025 03:38:44 +0000 (23:38 -0400)] 
gh-127840: Revert "gh-127840: pass flags and address from send_fds (GH-127841)" (#134482)

Revert "gh-127840: pass flags and address from send_fds (GH-127841)"

This reverts commit 518c95b5529ed3379b5a3065b09f71411efe72fb.

5 months agogh-134062: Fix hash collisions in IPv4Network and IPv6Network (GH-134063)
Mike Salvatore [Thu, 22 May 2025 02:48:10 +0000 (22:48 -0400)] 
gh-134062: Fix hash collisions in IPv4Network and IPv6Network (GH-134063)

gh-134062: Fix hash collisions in IPv4Network and IPv6Network
gh-134062: Add hash collision regression test

5 months agogh-127840: pass flags and address from send_fds (GH-127841)
Marcin Bachry [Thu, 22 May 2025 02:38:01 +0000 (04:38 +0200)] 
gh-127840: pass flags and address from send_fds (GH-127841)

socket: pass flags and address from send_fds

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
5 months agogh-127960 Fix the REPL to set the correct namespace by setting the correct `__main__...
Yuichiro Tachibana (Tsuchiya) [Thu, 22 May 2025 00:18:00 +0000 (19:18 -0500)] 
gh-127960 Fix the REPL to set the correct namespace by setting the correct `__main__` module (gh-134275)

The `__main__` module imported in the `_pyrepl` module points to the `_pyrepl` module itself when the interpreter was launched without `-m` option and didn't execute a module,
while it's an unexpected behavior that `__main__` can be `_pyrepl` and relative imports such as `from . import *` works based on the `_pyrepl` module.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
5 months agogh-132775: Use _PyFunction_VerifyStateless() and _PyCode_VerifyStateless() (gh-134439)
Eric Snow [Wed, 21 May 2025 20:16:55 +0000 (14:16 -0600)] 
gh-132775: Use _PyFunction_VerifyStateless() and _PyCode_VerifyStateless() (gh-134439)

5 months agogh-132983: Fix refleak in zstd dictionary functions (gh-134459)
Emma Smith [Wed, 21 May 2025 19:09:34 +0000 (15:09 -0400)] 
gh-132983: Fix refleak in zstd dictionary functions (gh-134459)

5 months agogh-132124: improve safety nets for creating AF_UNIX socket files (GH-134085)
Bénédikt Tran [Wed, 21 May 2025 17:10:31 +0000 (19:10 +0200)] 
gh-132124: improve safety nets for creating AF_UNIX socket files (GH-134085)

* ensure that we can create AF_UNIX socket files
* emit a warning if system-wide temporary directory is used

5 months agogh-80050: Update BufferedReader.read docs around non-blocking (GH-130653)
Cody Maloney [Wed, 21 May 2025 16:06:40 +0000 (12:06 -0400)] 
gh-80050: Update BufferedReader.read docs around non-blocking (GH-130653)

5 months agogh-132983: Refactor shared code in train_dict and finalize_dict (GH-134432)
Emma Smith [Wed, 21 May 2025 15:53:13 +0000 (11:53 -0400)] 
gh-132983: Refactor shared code in train_dict and finalize_dict (GH-134432)

Refactor shared code in train_dict and finalize_dict

5 months agogh-62184: Remove _pyio import of _io.FileIO (gh-134192)
Cody Maloney [Wed, 21 May 2025 15:29:18 +0000 (11:29 -0400)] 
gh-62184: Remove _pyio import of _io.FileIO (gh-134192)

This was added in the add of `_io`, isn't used since bpo-21859 when a
`_pyio` implementation was added which defines `FileIO` lower down in
the file.

5 months agogh-133982: Run unclosed file test on all io implementations (gh-134165)
Cody Maloney [Wed, 21 May 2025 14:51:56 +0000 (10:51 -0400)] 
gh-133982: Run unclosed file test on all io implementations (gh-134165)

Update `test_io` `_check_warn_on_dealloc` to use `self.` to dispatch to
different I/O implementations.

Update the `_pyio` implementation to match expected behavior, using the
same `_dealloc_warn` design as the C implementation uses to report the
topmost `__del__` object.

The FileIO one now matches all the others, so can use IOBase. There was
a missing check on closing (self._fd must be valid), add that check

5 months agogh-71253: Match _io exception in _pyio (gh-133985)
Cody Maloney [Wed, 21 May 2025 14:45:00 +0000 (10:45 -0400)] 
gh-71253: Match _io exception in _pyio (gh-133985)

Test was only testing _io, expanded to cover _pyio.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
5 months agogh-133982: Update test_bufio to use self.open (gh-133983)
Cody Maloney [Wed, 21 May 2025 14:40:50 +0000 (10:40 -0400)] 
gh-133982: Update test_bufio to use self.open (gh-133983)

5 months agogh-132246: Add special buffer methods to C API Type Object docs (gh-132247)
Cody Maloney [Wed, 21 May 2025 14:21:57 +0000 (10:21 -0400)] 
gh-132246: Add special buffer methods to C API Type Object docs (gh-132247)

Two special methods, __buffer__ and __release_buffer__ were added to
Python 3.12 by PEP 688. The C API Type Object documentation for slots
includes `tp_as_buffer`, and sub-slots `bf_getbuffer`, `bf_releasebuffer`
but does not refer to the Python Data Model version of those. Add the
missing references.

5 months agogh-132983: Add documentation for compression.zstd (GH-133911)
Emma Smith [Wed, 21 May 2025 14:18:21 +0000 (10:18 -0400)] 
gh-132983: Add documentation for compression.zstd (GH-133911)

Add documentation for compression & compression.zstd.

🎉

---------

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Sumana Harihareswara <sh@changeset.nyc>
Co-authored-by: Martin Panter <vadmium@users.noreply.github.com>