Commit Graph

131902 Commits

Author SHA1 Message Date
Miss Islington (bot) ffb5184dfb [3.15] gh-152682: Fix NULL dereference on OOM in symtable_visit_type_param_bound_or_default (GH-152684) (#152695)
In `symtable_visit_type_param_bound_or_default()`, when a reserved name
(e.g. `__classdict__`) is used as a type parameter, `PyUnicode_FromFormat()`
is called to build the SyntaxError message. If the allocation fails and
returns NULL, the subsequent `PyErr_SetObject()` and `Py_DECREF()` calls
would dereference NULL, causing a segfault.

Fix by returning 0 immediately when `PyUnicode_FromFormat()` returns NULL.
This propagates the MemoryError set by `PyUnicode_FromFormat()`.

The bug was introduced in gh-128632 (commit 891c61c).
(cherry picked from commit 10ed03edf1)

Co-authored-by: Petr Vaganov <petrvaganoff@gmail.com>

* Remove test

---------

Co-authored-by: Petr Vaganov <petrvaganoff@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-07-06 17:36:32 +01:00
Miss Islington (bot) fdba15ada0 [3.15] Docs: Link to the contextlib.chdir context manager in the os.chdir docs (GH-153152) (#153212)
(cherry picked from commit f155dbed4e)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-07-06 15:49:33 +00:00
Miss Islington (bot) 15a21e4ee2 [3.15] gh-152849: Fix OverflowError message for out-of-range timestamps in the time module (GH-152850) (#153209)
(cherry picked from commit 2d7a74ece7)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-07-06 15:25:47 +00:00
Miss Islington (bot) 8d215929f4 [3.15] gh-148286: Remove invalid test in test_decodeescape (GH-153187) (#153204)
(cherry picked from commit 8477652cc1)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-07-06 15:22:23 +00:00
Miss Islington (bot) 84af8f5c5a [3.15] Add tests for syntax error messages that had no test coverage (GH-153192) (GH-153196)
Add tests for syntax error messages that had no test coverage (GH-153192)

"illegal target for annotation" and "cannot use dict unpacking here"
were not tested at all, and "f-string: expecting '!', or ':', or '}'"
was only tested for its t-string variant.
(cherry picked from commit 836b2069c8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 14:20:55 +00:00
Miss Islington (bot) d3fbde571a [3.15] gh-146531: Skip hanging wm iconbitmap test on macOS 26 Intel (GH-148032) (#153190)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-07-06 12:56:14 +00:00
Miss Islington (bot) 52810f997a [3.15] gh-145098: Use macos-26-intel instead of macos-15-intel (GH-149991) (#153179)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-07-06 09:50:26 +00:00
Miss Islington (bot) 8e7c2ca7a0 [3.15] gh-148765: Fix description of *include_hidden* parameter in glob.glob() docs (GH-148768) (#153173)
(cherry picked from commit db3a4773e1)

Co-authored-by: Eoin Shaughnessy <45000144+EoinTrial@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-07-06 09:33:36 +00:00
Miss Islington (bot) 5ae62034e5 [3.15] gh-153141: Fix mutable default argument in _SharedMemoryTracker.__init__ (GH-153142) (#153145)
gh-153141: Fix mutable default argument in _SharedMemoryTracker.__init__ (GH-153142)

Fix default argument for segment_names in _SharedMemoryTracker constructor to not use a mutable list.
(cherry picked from commit d733b104d5)

Co-authored-by: Vineet Kumar <108144301+whyvineet@users.noreply.github.com>
2026-07-05 19:36:51 +00:00
Miss Islington (bot) 986322e613 [3.15] gh-105708: 'V' could be case insensitive for IPvFuture hostnames (GH-105709) (#153138)
gh-105708: 'V' could be case insensitive for IPvFuture hostnames (GH-105709)

* gh-105708: 'V' could be case insensitive for IPvFuture hostnames

* gh-105708: 'V' could be case insensitive for IPvFuture hostnames & checking empty hostnames

* 📜🤖 Added by blurb_it.

* Fix the Merge changing \z to \Z.

* Fixed the News Entry.

* Fix the lint.

---------
(cherry picked from commit a47a66ccef)

Co-authored-by: Chandra <csreddy1998@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Senthil Kumaran <senthil@python.org>
2026-07-05 10:52:46 -07:00
Miss Islington (bot) f2cd7ef89a [3.15] gh-143921: Narrow the control character check in imaplib commands (GH-153067) (GH-153135)
Only NUL, CR and LF are rejected now.  Other control characters are
valid in quoted strings and can occur in mailbox names returned by
the server, so they are now accepted and sent quoted.
(cherry picked from commit d0921efb66)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 15:58:48 +00:00
Miss Islington (bot) 1289306bcd [3.15] gh-68147: Fix RFC references in imaplib (GH-153126) (GH-153130)
Refer to RFC 3501, which obsoleted RFC 2060.  "]" is disallowed
in flags, not in tags.
(cherry picked from commit 74a2438bf7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 14:41:39 +00:00
Miss Islington (bot) 65b69363e7 [3.15] gh-149930: Clarify imaplib response helper types (GH-149963) (GH-153123)
(cherry picked from commit d2d415b976)

Co-authored-by: Savage Mechanic <savagemechanic@github.com>
Co-authored-by: savagemechanic <20458938+savagemechanic@users.noreply.github.com>
2026-07-05 16:27:34 +03:00
Miss Islington (bot) 2a5f9e0e24 [3.15] gh-79638: Restore "Treat an unreachable robots.txt as disallow all" (GH-152525) (GH-153107)
This change was accidentally reverted by f0daba1652 (gh-106693,
GH-149514), which only intended to revert the ob_sval change.
The tests were already restored by GH-149569.
(cherry picked from commit 70100b9ea0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 11:44:44 +00:00
Serhiy Storchaka 0416fcd7cf [3.15] gh-69134: Wait until mapped in SimpleDialog keyboard tests (GH-152690) (GH-153104)
The SimpleDialog keyboard tests generate key events after focus_force(),
which on Windows are dropped until the toplevel is mapped, so they could
fail intermittently (seen on the Windows10 buildbot as
test_return_no_default).  Wait until the window is mapped in these tests,
as GH-152599 did for the other keyboard tests.

(cherry picked from commit 7d619c2fea)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 11:42:24 +00:00
Miss Islington (bot) 202e751f79 [3.15] Fix minor typos in 'Compound statements' docs (GH-149666) (#153113)
(cherry picked from commit 856049a9d9)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-07-05 11:31:55 +00:00
Miss Islington (bot) d1fde1822f [3.15] gh-76607: Improve documentation of the tkinter cursor option (GH-152481) (GH-153110)
Link to the cursors(3tk) manual page for the available cursor names and
note that they are platform-dependent.
(cherry picked from commit ea5703735f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 14:24:25 +03:00
Miss Islington (bot) 7d3b991f4a [3.15] gh-54930: Send a status line in error responses to malformed request lines (GH-152980) (GH-153092)
Previously such error responses were sent in the bare HTTP/0.9 style,
without a status line and headers.
(cherry picked from commit 2ab620b41a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 11:22:09 +00:00
Miss Islington (bot) a862fbc7f0 [3.15] gh-123193: Document tkinter Variable lifetime (GH-152625) (GH-153098)
A Tk variable wrapper unsets its Tcl variable when garbage collected, so a
reference must be kept while a widget uses it.  Otherwise Tk recreates the Tcl
variable but never unsets it again, leaking it.
(cherry picked from commit 820b6ca22d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 11:15:56 +00:00
Miss Islington (bot) 67d782c6bc [3.15] gh-75952: Document negative offsets in tkinter geometry strings (GH-152531) (GH-153101)
Tk geometry strings can contain a negative offset (e.g. 200x100+-9+-8)
when a window edge is positioned beyond the corresponding screen edge.
Note this in the geometry() and winfo_geometry() documentation.
(cherry picked from commit 19b5e8e1f5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 11:15:42 +00:00
Miss Islington (bot) 88baea812e [3.15] Fix various typos in the http.server docs (GH-153089) (#153096)
(cherry picked from commit 99b4cdbfa1)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-07-05 11:07:29 +00:00
sobolevn f7eda8e130 [3.15] gh-150459: Fix SyntaxError message for from x lazy import y (GH-150877) (#153090)
(cherry picked from commit ec5f154e33)
2026-07-05 10:41:56 +00:00
Miss Islington (bot) 9b0a97c4c5 [3.15] gh-151945: fix Sphinx reference warnings in http.server docs (GH-153084) (#153085)
gh-151945: fix Sphinx reference warnings in `http.server` docs (GH-153084)
(cherry picked from commit 9f9787d834)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-07-05 09:33:42 +00:00
Miss Islington (bot) e9f92ac0b2 [3.15] gh-153030: Fix quadratic complexity in incremental parsing in HTMLParser (GH-153031) (GH-153038)
When an unterminated construct (e.g. a tag or comment) spanned many
feed() calls, rescanning the growing buffer and concatenating new data
onto it were both quadratic.  New data is now accumulated in a list and
only joined and parsed once enough has piled up.
(cherry picked from commit bcf98ddbc4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 08:57:20 +00:00
Miss Islington (bot) 6416d86afc [3.15] gh-66335: Test uppercase IMAP4 command names (GH-152876) (GH-153080)
(cherry picked from commit 3cd6b74064)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Milan Oberkirch <zvyn@oberkirch.org>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 08:40:12 +00:00
Miss Islington (bot) f8d7ae89f9 [3.15] Remove PDF images (GH-145977) (#153064)
(cherry picked from commit 5616505b44)

Co-authored-by: Stan Ulbrych <stan@python.org>
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
2026-07-05 10:26:29 +02:00
Miss Islington (bot) 14568f4acf [3.15] gh-151819: Clarify the conditional-pattern email example in re docs (GH-153072) (GH-153073)
The example pattern does not fail to match '<user@host.com' outright --
re.search finds 'user@host.com' in it; it only fails to match the
whole string.  Reword to say so.
(cherry picked from commit fe9c7213e6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 11:23:10 +03:00
Miss Islington (bot) f09f5dced1 [3.15] gh-67512: Document IMAP4.append() flags argument (GH-149907) (GH-153078)
(cherry picked from commit 5f8d9d3575)

Co-authored-by: Savage Mechanic <savagemechanic@github.com>
2026-07-05 08:05:51 +00:00
Serhiy Storchaka 2c99ec4388 [3.15] gh-40038: Quote imaplib command arguments when necessary (GH-152703) (GH-153066)
Argument quoting was inadvertently disabled when imaplib was ported to
Python 3 (bpo-1210 commented out the ``_checkquote()`` call, bpo-9638
then removed it), so since Python 3.0 commands failed for arguments
containing protocol-sensitive characters, such as a space in a mailbox
name.

Quoting is restored and reimplemented per the RFC 3501 grammar, so that
arguments that need quoting are escaped and quoted, while flags, sequence
sets and list wildcards are left intact.

For backward compatibility, an argument already enclosed in double quotes
is left unchanged, so code that quotes arguments itself keeps working.
(cherry picked from commit 600e86490f)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-05 06:55:59 +00:00
Miss Islington (bot) 7eb476dfbe [3.15] Add "new in 3.15" comments to idlelib (GH-153052) (#153054)
Add "new in 3.15" comments to idlelib (GH-153052)

Lazy keyword added to colorizer and test in PR-GH-142351.
Tested NameError hint expanded in PR-GH-144299.
(cherry picked from commit 0621639e8f)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2026-07-05 02:28:53 +00:00
Miss Islington (bot) 41a2abe06d [3.15] gh-152718: Reject oversized table counts in the profiling binary reader (GH-152719) (#153050)
gh-152718: Reject oversized table counts in the profiling binary reader (GH-152719)
(cherry picked from commit 8e580b0685)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
2026-07-04 23:27:41 +00:00
Miss Islington (bot) 9f82c25eca [3.15] gh-151378: Fix unbounded memory growth when recording binary and the thread is sleeping (GH-152089) (#153047)
gh-151378: Fix unbounded memory growth when recording binary and the thread is sleeping (GH-152089)
(cherry picked from commit 639a5525fb)

Co-authored-by: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
2026-07-04 19:34:15 +00:00
Miss Islington (bot) 960e152bf6 [3.15] gh-151945: Fix all reference warnings and various solecisms in the http.cookiejar docs (GH-152816) (#153032)
(cherry picked from commit 66c76fa673)

Co-authored-by: Harjoth Khara <harjoth.khara@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-07-04 15:11:20 +00:00
Miss Islington (bot) cb0adb0d94 [3.15] gh-152068: Reset PyREPL Colors on prompt finish (GH-152108) (#153029) 2026-07-04 13:49:59 +00:00
Miss Islington (bot) fdc17cab04 [3.15] gh-135661: Fix abrupt closing of empty comment in HTMLParser (GH-153007) (GH-153024)
An abruptly closed empty comment ("<!-->" or "<!--->") no longer extends
up to a later "-->" in the same feed() call.

test_htmlparser now also feeds each string source as a single chunk, in
addition to one character at a time, to exercise different input buffering.
(cherry picked from commit ed370d3337)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 12:36:03 +00:00
Miss Islington (bot) e1320ae4c3 [3.15] gh-152851: fix a crash when copying a BLAKE-2s/2b object (GH-153008) (#153011)
gh-152851: fix a crash when copying a BLAKE-2s/2b object (GH-153008)
(cherry picked from commit 5a400ceafb)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-07-04 10:41:40 +00:00
Miss Islington (bot) 2dd5d4e1ec [3.15] gh-150579: use lazy imports for concurrent.futures (GH-150585) (#152975)
gh-150579: use lazy imports for concurrent.futures (GH-150585)

This module has a manual lazy import hack using `__getattr__`. Now that lazy imports exist and cannot be disabled, this could use lazy imports instead.

Key differences: this will now show up in sys.lazy_modules when accessed. Error messages should be a bit better without the wrapper `__getattr__` involved.  That's the only differences I can think of.
(cherry picked from commit 423ae0ff36)

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2026-07-03 20:20:49 -07:00
Miss Islington (bot) 8d08232817 [3.15] gh-83386: Enable test_hang_gh83386 for ProcessPoolExecutor (GH-152976) (#152982)
gh-83386: Enable test_hang_gh83386 for ProcessPoolExecutor (GH-152976)

The hang this test guards against (interpreter exit after
shutdown(wait=False) with running futures) was fixed for
ProcessPoolExecutor by the executor management rewrite years ago, but
the test still skipped it citing the issue. The skip also hid a latent
NameError in the subprocess template, which only selects a start method
in the process pool variants; rewrite it to use the same
mp_context=get_context() shape as the sibling templates. Remove a stale
comment claiming ProcessPoolExecutor often hangs with wait=False.
(cherry picked from commit 548c731413)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 21:32:20 +00:00
Miss Islington (bot) ce373b845c [3.15] gh-152951 - Fix double DECREF when newblock fails during deque.extend calls (GH-152961) (#152971)
gh-152951 - Fix double DECREF when `newblock` fails during deque.extend calls (GH-152961)
(cherry picked from commit a90576d72c)

Co-authored-by: Steve Stagg <stestagg@gmail.com>
2026-07-03 18:14:59 +00:00
Miss Islington (bot) 138dd26337 [3.15] gh-152785: Upgrade LLVM to LLVM 21 in GitHub Action jobs (GH-152781) (#152968)
gh-152785: Upgrade LLVM to LLVM 21 in GitHub Action jobs (GH-152781)

Upgrade LLVM to LLVM 21 in GitHub Action jobs:

* Reusable Sanitizer
* Reusable Ubuntu ("Install Clang and BOLT")
(cherry picked from commit f5b3eefbda)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-07-03 16:48:51 +00:00
Miss Islington (bot) f3ef09e976 [3.15] gh-150880: Normalize paths on Windows before appending wildcard (GH-152906) (GH-152963)
gh-150880: Normalize paths on Windows before appending wildcard (GH-152906)

This ensures that we don't turn a "valid" path with trailing spaces into an invalid path with embedded spaces.
(cherry picked from commit 1b4135a2c6)

Co-authored-by: Zain Nadeem <zainnadeemzainnadeem80@gmail.com>
2026-07-03 16:02:22 +00:00
Miss Islington (bot) 8ad11e3d96 [3.15] gh-152785: Upgrade GCC from 10 to 13 in GHA Address Sanitizer (GH-152782) (#152949)
gh-152785: Upgrade GCC from 10 to 13 in GHA Address Sanitizer (GH-152782)

Remove the step which installs GCC 10. This step was needed when
Ubuntu only had GCC 9. We are now using Ubuntu 24.04 which has GCC
13.
(cherry picked from commit 31a0e0968e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-07-03 11:40:56 +00:00
Miss Islington (bot) fe23abac94 [3.15] gh-152903: Change PCWSTR to PWSTR in GetThreadDescription() typedef (GH-152904) (#152943)
gh-152903: Change PCWSTR to PWSTR in GetThreadDescription() typedef (GH-152904)

Fixes issue GH-152903
(cherry picked from commit ac1acb6d7d)

Co-authored-by: Carlo Bramini <carlo_bramini@users.sourceforge.net>
2026-07-03 11:33:14 +00:00
Miss Islington (bot) 2a7eb3d179 [3.15] gh-152870: Fix compile error with decimal when EXTRA_FUNCTIONALITY enabled (GH-152871) (#152937)
gh-152870: Fix compile error with decimal when EXTRA_FUNCTIONALITY enabled (GH-152871)
(cherry picked from commit c4739533f3)

Co-authored-by: Xiaowei Lu <weixlu420302@gmail.com>
2026-07-03 11:03:07 +00:00
Miss Islington (bot) 1b89ad7e00 [3.15] gh-150641: Fix evaluating forward references in STRING format can 'leak' internal names in typing (GH-150648) (#152935)
gh-150641: Fix evaluating forward references in STRING format can 'leak' internal names in `typing` (GH-150648)
(cherry picked from commit f75028f7ce)

Co-authored-by: Ivy Xu <fakeshadow1337@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-07-03 11:55:10 +02:00
Miss Islington (bot) d657028a6e [3.15] gh-152919: Ensure nuget.org source exist before python install (GH-152919)
(cherry picked from commit 8c35afa221)

Co-authored-by: Bart van der Braak <bartvdbraak@gmail.com>
2026-07-03 08:55:46 +00:00
Miss Islington (bot) c8c08cfe29 [3.15] gh-115634: Fix ProcessPoolExecutor deadlock with max_tasks_per_child (GH-140900) (#152926)
gh-115634: Fix ProcessPoolExecutor deadlock with max_tasks_per_child (GH-140900)

The idle worker semaphore counts task completions, not idle workers, so
it can hold a stale token released by a worker that later exited upon
reaching its max_tasks_per_child limit. The worker replacement path
consumed such tokens and skipped spawning a replacement, deadlocking
the remaining queued tasks once no workers were left.

Replace dead workers based on len(self._processes) without consulting
the semaphore. The submit() path is unchanged, preserving on-demand
spawning and idle worker reuse.

Replace the documentation note added in GH-140897 with a versionchanged
entry now that the bug is fixed.

Based on a fix proposed by Tabrez Mohammed.
(cherry picked from commit b706767d8f)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-07-03 06:37:25 +00:00
Miss Islington (bot) c09f078796 [3.15] gh-152785: Upgrade Java from 17 to 21 in GHA Android (GH-152783) (#152920)
Upgrade Java from 17 to 21 in GHA Android, and document the Java version
requirement.
(cherry picked from commit 0a13efc3fb)

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-07-03 02:56:16 +00:00
Terry Jan Reedy 984ebbfeec [3.15] gh-151428: Remove unused imports in idlelib.idle_test (GH-151478) (#152916) 2026-07-02 21:07:27 +00:00
Miss Islington (bot) 598856c7e4 [3.15] gh-152847: Reject POSIX TZ rule with non-digit day-of-year in _zoneinfo.py (GH-152848) (#152910)
(cherry picked from commit 31864bd9a6)

Co-authored-by: tonghuaroot (童话) <tonghuaroot@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-07-02 18:31:47 +00:00