]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
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>
5 months agogh-134026: Fix grammar description of for statement (GH-134034)
Yash Vijay [Wed, 21 May 2025 14:09:28 +0000 (19:39 +0530)] 
gh-134026: Fix grammar description of for statement (GH-134034)

5 months agogh-127833: lexical analysis: Improve section on Names (GH-131474)
Petr Viktorin [Wed, 21 May 2025 14:01:52 +0000 (16:01 +0200)] 
gh-127833: lexical analysis: Improve section on Names (GH-131474)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
5 months agogh-90871: fix connection backlog offset in asyncio (gh-134392)
Christian Harries [Wed, 21 May 2025 13:59:09 +0000 (14:59 +0100)] 
gh-90871: fix connection backlog offset in asyncio (gh-134392)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
5 months agogh-110631: Fix some incorrect indents in the documentation (#129312)
Yuki Kobayashi [Wed, 21 May 2025 13:52:02 +0000 (22:52 +0900)] 
gh-110631: Fix some incorrect indents in the documentation (#129312)

5 months agogh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-133482)
Eric Snow [Wed, 21 May 2025 13:23:48 +0000 (07:23 -0600)] 
gh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-133482)

It now supports a "full" fallback to _PyFunction_GetXIData() and then `_PyPickle_GetXIData()`.  There's also room for other fallback modes if that later makes sense.

5 months agogh-134262: Add retries to generate_sbom.py (#134263)
Emma Smith [Wed, 21 May 2025 13:14:36 +0000 (09:14 -0400)] 
gh-134262: Add retries to generate_sbom.py (#134263)

Co-authored-by: Semyon Moroz <donbarbos@proton.me>
5 months agogh-131185: Use a proper thread-local for cached thread states (gh-132510)
Peter Bierma [Wed, 21 May 2025 13:01:25 +0000 (09:01 -0400)] 
gh-131185: Use a proper thread-local for cached thread states (gh-132510)

Switches over to a _Py_thread_local in place of autoTssKey, and also fixes a few other checks regarding PyGILState_Ensure after finalization.

Note that this doesn't fix concurrent use of PyGILState_Ensure with Py_Finalize; I'm pretty sure zapthreads doesn't work at all, and that needs to be fixed seperately.

5 months agoFix signature of `_curses.assume_default_colors` in the docs (#134409)
sobolevn [Wed, 21 May 2025 12:56:34 +0000 (15:56 +0300)] 
Fix signature of `_curses.assume_default_colors` in the docs (#134409)

5 months agogh-132542: Only run test_native_id_after_fork if native_id is supported (GH-134408)
Noam Cohen [Wed, 21 May 2025 11:10:57 +0000 (14:10 +0300)] 
gh-132542: Only run test_native_id_after_fork if native_id is supported (GH-134408)

5 months agogh-134360 Add processName attribute to `logging.Formatter` docstring (GH-134371)
Sofia Toro [Wed, 21 May 2025 04:49:06 +0000 (00:49 -0400)] 
gh-134360 Add processName attribute to `logging.Formatter` docstring (GH-134371)

5 months agogh-72680: Fix false positives when using zipfile.is_zipfile() (GH-134250)
Tim Hatch [Wed, 21 May 2025 01:32:41 +0000 (18:32 -0700)] 
gh-72680: Fix false positives when using zipfile.is_zipfile() (GH-134250)

bpo-28494: Improve zipfile.is_zipfile reliability

The zipfile.is_zipfile function would only search for the EndOfZipfile
section header. This failed to correctly identify non-zipfiles that
contained this header. Now the zipfile.is_zipfile function verifies
the first central directory entry.

Changes:
* Extended zipfile.is_zipfile to verify zipfile catalog
* Added tests to validate failure of binary non-zipfiles
* Reuse 'concat' handling for is_zipfile

Co-authored-by: John Jolly <john.jolly@gmail.com>
5 months agogh-91048: Fix error path result in _remote_debugging_module (#134347)
Pablo Galindo Salgado [Tue, 20 May 2025 23:54:09 +0000 (19:54 -0400)] 
gh-91048: Fix error path result in _remote_debugging_module (#134347)

5 months agoAdd documentation for remote debugging with pdb (#134260)
ivonastojanovic [Tue, 20 May 2025 23:50:49 +0000 (19:50 -0400)] 
Add documentation for remote debugging with pdb (#134260)

* Mention remote debugging via -p PID in usage text

Adds a brief note to the pdb help summary about attaching to a running
process using the -p option, making the remote debugging feature
more visible.

* Mention remote debugging in pdb.rst

5 months agoGH-131798: Narrow types more aggressively in the JIT (GH-134373)
Brandt Bucher [Tue, 20 May 2025 22:09:51 +0000 (18:09 -0400)] 
GH-131798: Narrow types more aggressively in the JIT (GH-134373)

5 months agoGH-131798: Narrow the return type of _GET_LEN to int (GH-133345)
Nadeshiko Manju [Tue, 20 May 2025 22:02:50 +0000 (06:02 +0800)] 
GH-131798: Narrow the return type of _GET_LEN to int (GH-133345)

5 months agoGH-130727: Avoid race condition in _wmimodule by copying shared data (GH-134313)
Chris Eibl [Tue, 20 May 2025 21:21:25 +0000 (23:21 +0200)] 
GH-130727: Avoid race condition in _wmimodule by copying shared data (GH-134313)

5 months agogh-134209: use heap-allocated memory in `_curses.window.{instr,getstr}` (GH-134283)
tigerding [Tue, 20 May 2025 20:36:04 +0000 (16:36 -0400)] 
gh-134209: use heap-allocated memory in `_curses.window.{instr,getstr}` (GH-134283)

* made curses buffer heap allocated instead of stack
* change docs to explicitly mention the max buffer size
* changing GetStr() function to behave similarly too
* Update Doc/library/curses.rst
* Update instr with proper return error handling
* Update Modules/_cursesmodule.c
* change to strlen and better memory safety
* change from const int to Py_ssize_t
* add mem allocation guard
* update versionchanged to mention it was an increase.
* explicitly use versionchanged 3.14 as that is its own branch now.

TESTED: `python -m test -u curses test_curses`

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
5 months agogh-134215: PyREPL: Do not show underscored modules by default during autocompletion...
Kevin Hernández [Tue, 20 May 2025 20:26:48 +0000 (16:26 -0400)] 
gh-134215: PyREPL: Do not show underscored modules by default during autocompletion (gh-134267)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
5 months agogh-128066: Properly handle history file writes for RO fs on PyREPL (gh-134380)
Chris Patti [Tue, 20 May 2025 19:47:57 +0000 (15:47 -0400)] 
gh-128066: Properly handle history file writes for RO fs on PyREPL (gh-134380)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
5 months agogh-90117: handle dict and mapping views in pprint (#30135)
devdanzin [Tue, 20 May 2025 19:30:00 +0000 (16:30 -0300)] 
gh-90117: handle dict and mapping views in pprint (#30135)

* Teach pprint about dict views with PrettyPrinter._pprint_dict_view and ._pprint_dict_items_view.
* Use _private names for _dict_*_view attributes of PrettyPrinter.
* Use explicit 'items' keyword when calling _pprint_dict_view from _pprint_dict_items_view.
* 📜🤖 Added by blurb_it.
* Improve tests
* Add tests for collections.abc.[Keys|Items|Mapping|Values]View support in pprint.
* Add support for collections.abc.[Keys|Items|Mapping|Values]View in pprint.
* Split _pprint_dict_view into _pprint_abc_view, so pretty-printing normal dict views and ABC views is handled in two simple methods.
* Simplify redundant code.
* Add collections.abc views to some existing pprint tests.
* Test that views from collection.UserDict are correctly formatted by pprint.
* Handle recursive dict and ABC views.
* Test that subclasses of ABC views work in pprint.
* Test dict views coming from collections.Counter.
* Test ABC views coming from collections.ChainMap.
* Test odict views coming from collections.OrderedDict.
* Rename _pprint_abc_view to _pprint_mapping_abc_view.
* Add pprint test for mapping ABC views where ._mapping has a custom __repr__ and fix ChainMap test.
* When a mapping ABC view has a ._mapping that defines a custom __repr__, dispatch pretty-printing it by that __repr__.
* Add tests for ABC mapping views subclasses that don't replace __repr__, also handling those that delete ._mapping on instances.
* Simplify the pretty printing of ABC mapping views.
* Add a test for depth handling when pretty printing dict views.
* Fix checking whether the view type is a subclass of an items view, add a test.
* Move construction of the views __repr__ set out of _safe_repr.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
5 months agogh-127146: xfail more Emscripten stack overflows (#134358)
Hood Chatham [Tue, 20 May 2025 18:41:14 +0000 (14:41 -0400)] 
gh-127146: xfail more Emscripten stack overflows (#134358)

Adds some additional test xfails for Emscripten stack overflows. Also corrects a test skip for test_io.

5 months agogh-106213: Shorten Emscripten wasm-gc trampoline by a little (#133984)
Hood Chatham [Tue, 20 May 2025 18:22:49 +0000 (14:22 -0400)] 
gh-106213: Shorten Emscripten wasm-gc trampoline by a little (#133984)

Using the if instruction results in slightly shorter trampoline code.

5 months agogh-85045: clarified that the underlying buffer of a TextIOBase can be a RawIOBase...
Alex Kautz [Tue, 20 May 2025 18:18:58 +0000 (14:18 -0400)] 
gh-85045: clarified that the underlying buffer of a TextIOBase can be a RawIOBase (GH-134372)

Added a clarification that the underlying binary buffer of a TextIOBase can be a BufferedIOBase OR a RawIOBase

5 months agogh-127945: Update What's New in Python 3.14 for free-threaded ctypes (#134332)
Kumar Aditya [Tue, 20 May 2025 16:57:23 +0000 (22:27 +0530)] 
gh-127945: Update What's New in Python 3.14 for free-threaded ctypes (#134332)

5 months agogh-128002: add what's new docs for `asyncio` (#134324)
Kumar Aditya [Tue, 20 May 2025 16:41:58 +0000 (22:11 +0530)] 
gh-128002: add what's new docs for `asyncio` (#134324)

5 months agogh-122781: Allow empty offset for `%z` in `strptime` (#132922)
Stan Ulbrych [Tue, 20 May 2025 16:39:58 +0000 (17:39 +0100)] 
gh-122781: Allow empty offset for `%z` in `strptime` (#132922)

* commit

* Move tests

5 months agoGH-133779: Fix finding pyconfig.h on Windows JIT builds (GH-134349)
Brandt Bucher [Tue, 20 May 2025 16:32:26 +0000 (12:32 -0400)] 
GH-133779: Fix finding pyconfig.h on Windows JIT builds (GH-134349)

5 months agogh-132542: Set native thread ID after fork (GH-132701)
Noam Cohen [Tue, 20 May 2025 16:20:25 +0000 (19:20 +0300)] 
gh-132542: Set native thread ID after fork (GH-132701)

5 months agogh-76075: Correct `datetime.timestamp` documentation (#131202)
Stan Ulbrych [Tue, 20 May 2025 16:18:53 +0000 (17:18 +0100)] 
gh-76075: Correct `datetime.timestamp` documentation (#131202)

* Clean up timestamp docs

* Update datetime.rst

* Suggestion

5 months agogh-133980: use atomic store in `PyObject_GenericSetDict` (#133988)
Kumar Aditya [Tue, 20 May 2025 15:41:47 +0000 (21:11 +0530)] 
gh-133980: use atomic store in `PyObject_GenericSetDict` (#133988)

5 months agogh-129748: Update mimalloc to use atomic store for mi_block_set_nextx (#134238)
Donghee Na [Tue, 20 May 2025 15:39:56 +0000 (11:39 -0400)] 
gh-129748: Update mimalloc to use atomic store for mi_block_set_nextx (#134238)

5 months agogh-115999: Add PyCodeObject.co_tlbc to the debug offsets (#134286)
Pablo Galindo Salgado [Tue, 20 May 2025 15:31:37 +0000 (11:31 -0400)] 
gh-115999: Add PyCodeObject.co_tlbc to the debug offsets (#134286)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
5 months agoGH-134282: Always borrow references LOAD_CONST (GH-134284)
Mark Shannon [Tue, 20 May 2025 15:24:11 +0000 (11:24 -0400)] 
GH-134282: Always borrow references LOAD_CONST (GH-134284)

5 months agogh-86802: Fix asyncio memory leak; shielded task exceptions log once through the...
Christian Harries [Tue, 20 May 2025 15:14:27 +0000 (16:14 +0100)] 
gh-86802: Fix asyncio memory leak; shielded task exceptions log once through the exception handler (gh-134331)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
5 months agogh-101100: Fix Sphinx warnings in `library/decimal.rst` (#134303)
Yuki Kobayashi [Tue, 20 May 2025 14:46:13 +0000 (23:46 +0900)] 
gh-101100: Fix Sphinx warnings in `library/decimal.rst` (#134303)

5 months agogh-62824: Add alias for iso-8859-8-i which is the same as iso-8859-8 (gh-134306)
Bas Bloemsaat [Tue, 20 May 2025 13:14:02 +0000 (09:14 -0400)] 
gh-62824:  Add alias for iso-8859-8-i which is the same as iso-8859-8 (gh-134306)

Co-authored-by: David Goncalves <davegoncalves@gmail.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
5 months agogh-75459: Doc: C API: Improve object life cycle documentation (GH-125962)
Richard Hansen [Tue, 20 May 2025 12:25:50 +0000 (08:25 -0400)] 
gh-75459: Doc: C API: Improve object life cycle documentation (GH-125962)

  * Add "cyclic isolate" to the glossary.
  * Add a new "Object Life Cycle" page.
  * Improve docs for related API, with special focus on cross-references and warnings

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
5 months agogh-131357: Add tests for zero-sized bytes objects in test_bytes.py (#134234)
abstractedfox [Tue, 20 May 2025 12:24:27 +0000 (08:24 -0400)] 
gh-131357: Add tests for zero-sized bytes objects in test_bytes.py (#134234)

Co-authored-by: Victor Stinner <vstinner@python.org>
5 months agogh-53189: Document peculiarities of InteractiveConsole in relation to pickle (GH...
Serhiy Storchaka [Tue, 20 May 2025 12:08:40 +0000 (15:08 +0300)] 
gh-53189: Document peculiarities of InteractiveConsole in relation to pickle (GH-123069)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 months agogh-72902: improve Fraction constructor speed for typical inputs (GH-134320)
Sergey B Kirpichev [Tue, 20 May 2025 09:47:27 +0000 (12:47 +0300)] 
gh-72902: improve Fraction constructor speed for typical inputs (GH-134320)

This moves abc check for numbers.Rational - down.