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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
gh-98894: Check tracer exit status in test_dtrace (GH-152893)
Fail functional dtrace and SystemTap cases directly when the tracer exits
non-zero.
(cherry picked from commit 311e7e79f4)
Co-authored-by: stratakis <cstratak@redhat.com>
gh-152680: Detect virtualization on Windows in pythoninfo (GH-152824)
Use WMI to detect virtualization on Windows.
Replace wmic command with _wmi module to get the operating system caption and
version.
The wmic tool is deprecated since January 2024:
https://techcommunity.microsoft.com/blog/windows-itpro-blog/wmi-command-line-wmic-utility-deprecation-next-steps/4039242
For example, it's no longer installed in Windows images on GitHub
Action.
Fix also run_command(): no longer try to spawn a subprocess if the
platform doesn't support subprocess. It avoids logging run_command()
errors.
(cherry picked from commit 4e4869b62f)
Co-authored-by: Victor Stinner <vstinner@python.org>
Some IMAP servers send an extra blank line after the data of a literal.
imaplib mistook it for the response trailer and failed on the next
command. Such a blank line is now skipped.
(cherry picked from commit 53ff1a28cc)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>