]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 weeks agogh-152951 - Fix double DECREF when `newblock` fails during deque.extend calls (#152961)
Steve Stagg [Fri, 3 Jul 2026 17:43:24 +0000 (18:43 +0100)] 
gh-152951 - Fix double DECREF when `newblock` fails during deque.extend calls (#152961)

3 weeks agogh-150880: Normalize paths on Windows before appending wildcard (GH-152906)
Zain Nadeem [Fri, 3 Jul 2026 15:30:02 +0000 (20:30 +0500)] 
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.

3 weeks agogh-152066: Merge `_GUARD_DORV_VALUES_INST_ATTR_FROM_DICT` into `_CHECK_MANAGED_OBJECT...
Aniket [Fri, 3 Jul 2026 13:22:17 +0000 (18:52 +0530)] 
gh-152066: Merge `_GUARD_DORV_VALUES_INST_ATTR_FROM_DICT` into `_CHECK_MANAGED_OBJECT_HAS_VALUES` (GH-152231)

3 weeks agogh-152785: Upgrade LLVM to LLVM 21 in GitHub Action jobs (#152781)
Victor Stinner [Fri, 3 Jul 2026 11:44:24 +0000 (13:44 +0200)] 
gh-152785: Upgrade LLVM to LLVM 21 in GitHub Action jobs (#152781)

Upgrade LLVM to LLVM 21 in GitHub Action jobs:

* Reusable Sanitizer
* Reusable Ubuntu ("Install Clang and BOLT")

3 weeks agogh-152903: Change PCWSTR to PWSTR in GetThreadDescription() typedef (#152904)
Carlo Bramini [Fri, 3 Jul 2026 11:05:43 +0000 (13:05 +0200)] 
gh-152903: Change PCWSTR to PWSTR in GetThreadDescription() typedef (#152904)

Fixes issue #152903

3 weeks agogh-152870: Fix compile error with decimal when EXTRA_FUNCTIONALITY enabled (#152871)
Xiaowei Lu [Fri, 3 Jul 2026 10:34:15 +0000 (18:34 +0800)] 
gh-152870: Fix compile error with decimal when EXTRA_FUNCTIONALITY enabled (#152871)

3 weeks agogh-150641: Fix evaluating forward references in STRING format can 'leak' internal...
Ivy Xu [Fri, 3 Jul 2026 08:42:06 +0000 (16:42 +0800)] 
gh-150641: Fix evaluating forward references in STRING format can 'leak' internal names in `typing` (#150648)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
3 weeks agogh-152919: Ensure nuget.org source exist before python install (GH-152919)
Bart van der Braak [Fri, 3 Jul 2026 08:27:56 +0000 (10:27 +0200)] 
gh-152919: Ensure nuget.org source exist before python install (GH-152919)

Ensure `nuget.org` source exist before `python` install

3 weeks agogh-115634: Fix ProcessPoolExecutor deadlock with max_tasks_per_child (GH-140900)
Gregory P. Smith [Fri, 3 Jul 2026 06:08:47 +0000 (23:08 -0700)] 
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.

3 weeks agogh-152785: Upgrade Java from 17 to 21 in GHA Android (#152783)
Victor Stinner [Fri, 3 Jul 2026 02:27:13 +0000 (04:27 +0200)] 
gh-152785: Upgrade Java from 17 to 21 in GHA Android (#152783)

Upgrade Java from 17 to 21 in GHA Android, and document the Java version
requirement.

3 weeks agogh-152847: Reject POSIX TZ rule with non-digit day-of-year in `_zoneinfo.py` (#152848)
tonghuaroot (童话) [Thu, 2 Jul 2026 18:04:53 +0000 (02:04 +0800)] 
gh-152847: Reject POSIX TZ rule with non-digit day-of-year in `_zoneinfo.py` (#152848)

Co-authored-by: Stan Ulbrych <stan@python.org>
3 weeks agogh-152691: tarfile -- add Windows reserved name section (GH-152701)
Zain Nadeem [Thu, 2 Jul 2026 17:57:15 +0000 (22:57 +0500)] 
gh-152691: tarfile -- add Windows reserved name section (GH-152701)

3 weeks agogh-152813: Fix curses build warning on macOS (GH-152814)
Andrii Hrimov [Thu, 2 Jul 2026 15:38:41 +0000 (17:38 +0200)] 
gh-152813: Fix curses build warning on macOS (GH-152814)

3 weeks agogh-98894: Check tracer exit status in test_dtrace (#152893)
stratakis [Thu, 2 Jul 2026 15:07:24 +0000 (17:07 +0200)] 
gh-98894: Check tracer exit status in test_dtrace (#152893)

Fail functional dtrace and SystemTap cases directly when the tracer exits
non-zero.

3 weeks agogh-86165: Fix Time2Internaldate with datetime timetuple (GH-151844)
Xiao Yuan [Thu, 2 Jul 2026 15:00:20 +0000 (18:00 +0300)] 
gh-86165: Fix Time2Internaldate with datetime timetuple (GH-151844)

3 weeks agogh-152785: Upgrade GCC from 10 to 13 in GHA Address Sanitizer (#152782)
Victor Stinner [Thu, 2 Jul 2026 14:52:28 +0000 (16:52 +0200)] 
gh-152785: Upgrade GCC from 10 to 13 in GHA Address Sanitizer (#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.

3 weeks agogh-144067: Document terminal leak when initscr() follows setupterm() (GH-152624)
Serhiy Storchaka [Thu, 2 Jul 2026 14:19:42 +0000 (17:19 +0300)] 
gh-144067: Document terminal leak when initscr() follows setupterm() (GH-152624)

The curses library keeps a single current terminal: calling initscr()
or newterm() after setupterm() abandons the terminal that setupterm()
allocated without freeing it.  This cannot be fixed safely in code
(freeing the terminal would break the capsule API and pending terminfo
queries), so document the behavior, with a cross-reference from
initscr() and newterm().

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-152789: Skip curses tests needing newterm() on ncurses before 6.5 (GH-152880)
Serhiy Storchaka [Thu, 2 Jul 2026 14:07:30 +0000 (17:07 +0300)] 
gh-152789: Skip curses tests needing newterm() on ncurses before 6.5 (GH-152880)

ncurses before 6.5 can crash on repeated newterm().  Fall back to initscr()
in TestCurses and skip ScreenTests and SLKTests, which need several screens.
The shared initscr() screen also needs its rendition and background reset
between tests.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-98894: Check readelf failures in test_dtrace (#152345)
stratakis [Thu, 2 Jul 2026 13:33:47 +0000 (15:33 +0200)] 
gh-98894: Check readelf failures in test_dtrace (#152345)

Report readelf command failures directly instead of later failing with
missing-probe assertions.

3 weeks agogh-152680: Detect virtualization on Windows in pythoninfo (#152824)
Victor Stinner [Thu, 2 Jul 2026 13:00:51 +0000 (15:00 +0200)] 
gh-152680: Detect virtualization on Windows in pythoninfo (#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.

3 weeks agogh-88574: Skip a spurious blank line after a literal in imaplib (GH-152751)
Serhiy Storchaka [Thu, 2 Jul 2026 12:55:58 +0000 (15:55 +0300)] 
gh-88574: Skip a spurious blank line after a literal in imaplib (GH-152751)

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.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 weeks agogh-150069: Test frozen dataclass and properties interaction (#150070)
sobolevn [Thu, 2 Jul 2026 12:48:47 +0000 (15:48 +0300)] 
gh-150069: Test frozen dataclass and properties interaction (#150070)

3 weeks agogh-49680: Add translate_line_endings parameter to imaplib.IMAP4.append (GH-152775)
Serhiy Storchaka [Thu, 2 Jul 2026 11:17:37 +0000 (14:17 +0300)] 
gh-49680: Add translate_line_endings parameter to imaplib.IMAP4.append (GH-152775)

Pass False to send the message as an exact sequence of octets, without
rewriting bare CR or LF to CRLF.

Also add tests for the APPEND command, including an email message
round-trip.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: harjoth <harjoth.khara@gmail.com>
3 weeks agogh-66335: Add tests for imaplib command methods (GH-152872)
Serhiy Storchaka [Thu, 2 Jul 2026 10:14:44 +0000 (13:14 +0300)] 
gh-66335: Add tests for imaplib command methods (GH-152872)

Add coverage tests for the IMAP4 command methods and their UID variants
(SELECT, CREATE, COPY, STORE, FETCH, SEARCH, SORT, THREAD, DELETE,
RENAME, SUBSCRIBE, UNSUBSCRIBE, LIST, STATUS, the ACL and quota
commands, ANNOTATION, PROXYAUTH and ENABLE), plus test helpers
(splitargs, parse_sequence_set, make_simple_handler) and per-command
argument capture in the test server.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 weeks agogh-152569: Fix asyncio.wait leaking tasks via await-graph on long-lived futures ...
Simon Knott [Thu, 2 Jul 2026 07:50:12 +0000 (09:50 +0200)] 
gh-152569: Fix asyncio.wait leaking tasks via await-graph on long-lived futures (#152585)

3 weeks agogh-72507: Document that imaplib does not verify TLS certificates by default (GH-152778)
Serhiy Storchaka [Thu, 2 Jul 2026 07:19:11 +0000 (10:19 +0300)] 
gh-72507: Document that imaplib does not verify TLS certificates by default (GH-152778)

IMAP4_SSL() and IMAP4.starttls() do not verify the server certificate or
hostname unless a suitable ssl_context is passed.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 weeks agogh-79964: Clarify the imaplib fetch example in the docs (GH-152780)
Serhiy Storchaka [Thu, 2 Jul 2026 07:18:51 +0000 (10:18 +0300)] 
gh-79964: Clarify the imaplib fetch example in the docs (GH-152780)

A FETCH response may contain additional or unsolicited data, so the
message is not always data[0][1].

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 weeks agogh-108280: Give a meaningful error for an invalid imaplib greeting (GH-152768)
Serhiy Storchaka [Thu, 2 Jul 2026 07:15:13 +0000 (10:15 +0300)] 
gh-108280: Give a meaningful error for an invalid imaplib greeting (GH-152768)

Connecting to a server that does not send a valid IMAP4 greeting, such as
a POP3 server answering on the IMAP port, failed with the unhelpful
"imaplib.IMAP4.error: None".  A meaningful message is now raised instead.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 weeks agogh-63121: Refresh imaplib capabilities on state changes (GH-152752)
Serhiy Storchaka [Thu, 2 Jul 2026 07:10:27 +0000 (10:10 +0300)] 
gh-63121: Refresh imaplib capabilities on state changes (GH-152752)

imaplib fetched the server capabilities only once, at connection time.
They are now also refreshed after a successful LOGIN or AUTHENTICATE,
from the CAPABILITY response the server sent or, if it sent none, by
querying it.  This lets methods such as enable() see capabilities added
after login, for example ENABLE on Gmail (gh-103451).

Capabilities advertised in the server greeting are now used too, saving
a redundant CAPABILITY command.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 weeks agogh-135142: update idlelib News3.txt for 9 issues (#152839)
Terry Jan Reedy [Thu, 2 Jul 2026 02:54:30 +0000 (22:54 -0400)] 
gh-135142: update idlelib News3.txt for 9 issues (#152839)

13 posted 2026 June 30 for various issues.
Edited one other by me.

3 weeks agogh-151763: Fix OOM-0013 crash when the parser or compiler fails to allocate (#151968)
tonghuaroot (童话) [Thu, 2 Jul 2026 00:34:16 +0000 (08:34 +0800)] 
gh-151763: Fix OOM-0013 crash when the parser or compiler fails to allocate (#151968)

3 weeks agogh-82183: Do not restart the busy IDLE shell when running without restart (#152745)
Serhiy Storchaka [Wed, 1 Jul 2026 23:00:18 +0000 (02:00 +0300)] 
gh-82183: Do not restart the busy IDLE shell when running without restart (#152745)

"Run... Customized" with "Restart shell" unchecked restarted the shell
anyway when it was busy executing code, killing any pending input.  It now
reports that the shell is executing just once, not twice, and does not run.

3 weeks agogh-75595: Do not save a blank int entry in IDLE Settings (#152743)
Serhiy Storchaka [Wed, 1 Jul 2026 21:57:47 +0000 (00:57 +0300)] 
gh-75595: Do not save a blank int entry in IDLE Settings (#152743)

gh-83653: Do not save a blank int entry in IDLE Settings

Blanking an integer entry wrote an empty string to the config file, which
caused an "invalid int value" warning when it was read back.

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
3 weeks agogh-65339: Save IDLE Shell and Output windows as text by default (#152742)
Serhiy Storchaka [Wed, 1 Jul 2026 20:36:34 +0000 (23:36 +0300)] 
gh-65339: Save IDLE Shell and Output windows as text by default (#152742)

Their content is not Python source, so the Save As dialog now lists text
files first and defaults to a ".txt" extension.

3 weeks agogh-152433 Allow faulthandler.c to build for Windows UWP (GH-152688)
thexai [Wed, 1 Jul 2026 18:50:07 +0000 (20:50 +0200)] 
gh-152433 Allow faulthandler.c to build for Windows UWP (GH-152688)

3 weeks agogh-152682: Remove non-functional `test_syntax.test_disallowed_type_param_names_oom...
Petr Vaganov [Wed, 1 Jul 2026 17:38:09 +0000 (22:38 +0500)] 
gh-152682: Remove non-functional `test_syntax.test_disallowed_type_param_names_oom` (#152770)

3 weeks agogh-80504: Always show the full search path in IDLE Find in Files (#152740)
Serhiy Storchaka [Wed, 1 Jul 2026 17:05:56 +0000 (20:05 +0300)] 
gh-80504: Always show the full search path in IDLE Find in Files (#152740)

The "In files:" field of the Find in Files dialog now always contains a
full directory path, so the grep output shows which directory was searched.

3 weeks agogh-134300: Remove idlelib from the path of the IDLE user process (#152739)
Serhiy Storchaka [Wed, 1 Jul 2026 16:35:57 +0000 (19:35 +0300)] 
gh-134300: Remove idlelib from the path of the IDLE user process (#152739)

The idlelib directory ends up on sys.path when idle.py is run as a script,
and it was passed to the user process, where it let user code import
idlelib submodules as top-level modules, such as "import help".

3 weeks agogh-89360: Fix ValueError in IDLE MultiCall event_delete (#152738)
Serhiy Storchaka [Wed, 1 Jul 2026 16:22:03 +0000 (19:22 +0300)] 
gh-89360: Fix ValueError in IDLE MultiCall event_delete (#152738)

Deleting a key binding for a sequence not bound to the virtual event no
longer raises a ValueError; the discrepancy is now ignored.

3 weeks agogh-71956: Fix IDLE Replace All searching up without wrap around (#152737)
Serhiy Storchaka [Wed, 1 Jul 2026 15:55:43 +0000 (18:55 +0300)] 
gh-71956: Fix IDLE Replace All searching up without wrap around (#152737)

When the search direction is "Up" and "Wrap around" is off, Replace All
replaced only the first match above the current position (and all matches
below it).  It now replaces all matches from the start of the text down to
the current position, consistently with the "Up" direction.

3 weeks agogh-66331: Set correct WM_CLASS on X11 for IDLE windows (#152733)
Serhiy Storchaka [Wed, 1 Jul 2026 15:10:49 +0000 (18:10 +0300)] 
gh-66331: Set correct WM_CLASS on X11 for IDLE windows (#152733)

Set the WM_CLASS of IDLE's long-lived windows (window-list windows and
the stack viewers) to "Idle" instead of the default "Toplevel", so that
window managers group and label them correctly.

3 weeks agoUse tk_scaling() instead of a raw Tcl call in IDLE and tkinter tests (#152788)
Terry Jan Reedy [Wed, 1 Jul 2026 15:08:37 +0000 (11:08 -0400)] 
Use tk_scaling() instead of a raw Tcl call in IDLE and tkinter tests (#152788)

Replace `tk.call('tk', 'scaling')` with `tk_scaling()`, which
returns a float, in idlelib.util and test_tkinter.widget_tests.

Co-authored-by: serhiy-storchaka
3 weeks agoGH-148874: Make sure that mngr.__exit__() is always called in a with statement (GH...
Mark Shannon [Wed, 1 Jul 2026 14:15:33 +0000 (15:15 +0100)] 
GH-148874: Make sure that mngr.__exit__() is always called in a with statement (GH-150911)

* Even if there is an interrupt during the call to mngr.__enter__()

3 weeks agoFix copy paste error with Py_mod_state_traverse (GH-152776)
Petr Viktorin [Wed, 1 Jul 2026 12:22:34 +0000 (14:22 +0200)] 
Fix copy paste error with Py_mod_state_traverse (GH-152776)

Co-authored-by: hydrogen-mvm <hydrogen-mvm@users.noreply.github.com>
3 weeks agogh-144473: Add "steal" term to glossary; clarify "stealing" on error (GH-144502)
Petr Viktorin [Wed, 1 Jul 2026 11:47:00 +0000 (13:47 +0200)] 
gh-144473: Add "steal" term to glossary; clarify "stealing" on error (GH-144502)

With one exception, all "stealing" functions also steal on error,
but it makes sense to note this in each case.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
3 weeks agoBump the `actions/{github-script,checkout}` and `j178/prek-action` actions (#152760)
dependabot[bot] [Wed, 1 Jul 2026 11:36:43 +0000 (11:36 +0000)] 
Bump the `actions/{github-script,checkout}` and `j178/prek-action` actions (#152760)

Bumps the actions group with 3 updates: [actions/github-script](https://github.com/actions/github-script), [actions/checkout](https://github.com/actions/checkout) and [j178/prek-action](https://github.com/j178/prek-action).

Updates `actions/github-script` from 8.0.0 to 9.0.0
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/ed597411d8f924073f98dfc5c65a23a2325f34cd...3a2844b7e9c422d3c10d287c895573f7108da1b3)

Updates `actions/checkout` from 6.0.2 to 7.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

Updates `j178/prek-action` from 1.1.1 to 2.0.4
- [Release notes](https://github.com/j178/prek-action/releases)
- [Commits](https://github.com/j178/prek-action/compare/0bb87d7f00b0c99306c8bcb8b8beba1eb581c037...bdca6f102f98e2b4c7029491a53dfd366469e33d)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: j178/prek-action
  dependency-version: 2.0.4
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 weeks agoUse `@force_not_colorized` in `test_syntactical_future_repl` (#152749)
Shahar Naveh [Wed, 1 Jul 2026 11:20:38 +0000 (14:20 +0300)] 
Use `@force_not_colorized` in `test_syntactical_future_repl` (#152749)

3 weeks agoBump `hypothesis` from `6.151.9` to `6.155.3` in `Tools/requirements-hypothesis.txt...
dependabot[bot] [Wed, 1 Jul 2026 10:14:23 +0000 (12:14 +0200)] 
Bump `hypothesis` from `6.151.9` to `6.155.3` in `Tools/requirements-hypothesis.txt` (#152758)

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.151.9 to 6.155.3.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.151.9...v6.155.3)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-version: 6.155.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 weeks agogh-152157: Reject empty fractions in `_datetime.{date}time.fromisoformat` (#152161)
tonghuaroot (童话) [Wed, 1 Jul 2026 09:54:02 +0000 (17:54 +0800)] 
gh-152157: Reject empty fractions in `_datetime.{date}time.fromisoformat` (#152161)

Co-authored-by: Stan Ulbrych <stan@python.org>
3 weeks agogh-133031: Fix test_textbox_unicode on a narrow build (GH-152750)
Serhiy Storchaka [Wed, 1 Jul 2026 08:43:19 +0000 (11:43 +0300)] 
gh-133031: Fix test_textbox_unicode on a narrow build (GH-152750)

A narrow build stores one byte per cell, so skip the multi-byte cases there,
as already done for test_textbox_edit_wide.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-151626: Fix tests that fail when PYTHONPYCACHEPREFIX is set (GH-151952)
Jiucheng(Oliver) [Wed, 1 Jul 2026 05:31:43 +0000 (01:31 -0400)] 
gh-151626: Fix tests that fail when PYTHONPYCACHEPREFIX is set (GH-151952)

Fix tests in test_compileall, test_import, test_importlib, test_py_compile, and test_inspect to neutralize PYTHONPYCACHEPREFIX

3 weeks agogh-152728: IDLE - move 3 toplevel fix_xyz functions to idlelb.util (#152729)
Terry Jan Reedy [Wed, 1 Jul 2026 04:58:39 +0000 (00:58 -0400)] 
gh-152728: IDLE - move 3 toplevel fix_xyz functions to idlelb.util (#152729)

IDLE - move 3 toplevel fix_xyz functions to idlelb.util

Move idlelib functions run.fix_scaling, editor.fixwordbreaks
(as fix_word_breaks).  All are used in at least 3 modules.

3 weeks agogh-152711: Add pythoninfo-build command to Platforms/Android (#152713)
Victor Stinner [Wed, 1 Jul 2026 03:00:03 +0000 (05:00 +0200)] 
gh-152711: Add pythoninfo-build command to Platforms/Android (#152713)

Add a pythoninfo-build command to Platforms/Android to display build
info of the build Python. The command runs "make pythoninfo".

ci and build commands now also run pythoninfo-build

3 weeks agogh-152715: Add pythoninfo-build command to Platforms/Apple (#152716)
Victor Stinner [Wed, 1 Jul 2026 02:59:42 +0000 (04:59 +0200)] 
gh-152715: Add pythoninfo-build command to Platforms/Apple (#152716)

Add a pythoninfo-build command to Platforms/Apple to display build
info of the build Python. The command runs "make pythoninfo".

The "ci" and "build" commands now also run "pythoninfo-build".

3 weeks agogh-152433: Windows: enable mmapmodule for UWP (#152473)
thexai [Tue, 30 Jun 2026 20:49:01 +0000 (22:49 +0200)] 
gh-152433: Windows: enable mmapmodule for UWP (#152473)

3 weeks agogh-152433: Windows: use GetFileSizeEx instead of GetFileSize for memory mapped files...
thexai [Tue, 30 Jun 2026 20:35:44 +0000 (22:35 +0200)] 
gh-152433: Windows: use GetFileSizeEx instead of GetFileSize for memory mapped files (#152383)

3 weeks agoGH-81881: Raise `SpecialFileError` for sockets and devices in `shutil.copyfile` ...
Savannah Ostrowski [Tue, 30 Jun 2026 19:50:41 +0000 (12:50 -0700)] 
GH-81881: Raise `SpecialFileError` for sockets and devices in `shutil.copyfile` (#142693)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Senthil Kumaran <senthil@python.org>
3 weeks agogh-152502: Detect the curses mouse interface and is_* methods portably (GH-152705)
Serhiy Storchaka [Tue, 30 Jun 2026 19:24:07 +0000 (22:24 +0300)] 
gh-152502: Detect the curses mouse interface and is_* methods portably (GH-152705)

The mouse interface (getmouse(), has_mouse(), the BUTTON* constants,
window.mouse_trafo(), ...) and the window is_*() state-query methods were gated
on ncurses-specific macros, so they were dropped on other curses implementations
that provide them, such as NetBSD curses and PDCurses.

Gate them instead on configure capability probes (for functions NetBSD curses
provides, since it defines no identifying macro) or on NCURSES_EXT_FUNCS or the
PDCURSES macro (for functions only ncurses and PDCurses provide).  Probe for
getmouse() with its X/Open getmouse(MEVENT *) signature, since PDCurses declares
an incompatible getmouse(void) unless built for the ncurses mouse API, which
PDC_NCMOUSE now always selects.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-145857: Replace `DELETE_GLOBAL` with `PUSH_NULL; STORE_GLOBAL` (GH-146314)
Brij Kapadia [Tue, 30 Jun 2026 18:04:56 +0000 (14:04 -0400)] 
gh-145857: Replace `DELETE_GLOBAL` with `PUSH_NULL; STORE_GLOBAL` (GH-146314)

3 weeks agogh-145854: Replace `DELETE_NAME` with `PUSH_NULL; STORE_NAME` (GH-146006)
Brij Kapadia [Tue, 30 Jun 2026 16:21:31 +0000 (12:21 -0400)] 
gh-145854: Replace `DELETE_NAME` with `PUSH_NULL; STORE_NAME` (GH-146006)

3 weeks agogh-152680: Detect container/VM in test.pythoninfo (#152668)
Victor Stinner [Tue, 30 Jun 2026 15:11:57 +0000 (17:11 +0200)] 
gh-152680: Detect container/VM in test.pythoninfo (#152668)

On Apple, log the hardware model as "system.hardware".

* Log the "CI", "IMAGE_OS_VERSION" and "container"
  environment variables.
* Add run_command() and first_line() functions.

3 weeks agogh-152682: Fix NULL dereference on OOM in `symtable_visit_type_param_bound_or_default...
Petr Vaganov [Tue, 30 Jun 2026 14:45:25 +0000 (21:45 +0700)] 
gh-152682: Fix NULL dereference on OOM in `symtable_visit_type_param_bound_or_default` (#152684)

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).

3 weeks agogh-151881: Skip tk_inactive negativity check on Windows (GH-152683)
Serhiy Storchaka [Tue, 30 Jun 2026 14:25:42 +0000 (17:25 +0300)] 
gh-151881: Skip tk_inactive negativity check on Windows (GH-152683)

On Windows the inactivity time can overflow to a negative value
(Tk ticket 3cb7c4ac72d4).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-152546: Refactor `mappingproxy.__new__` to use `PyDictProxy_New` (#152547)
sobolevn [Tue, 30 Jun 2026 13:58:31 +0000 (16:58 +0300)] 
gh-152546: Refactor `mappingproxy.__new__` to use `PyDictProxy_New` (#152547)

3 weeks agogh-151126: Fix a possible crash during the startup with no memory under `Py_STACKREF_...
sobolevn [Tue, 30 Jun 2026 11:28:17 +0000 (14:28 +0300)] 
gh-151126: Fix a possible crash during the startup with no memory under `Py_STACKREF_DEBUG` (#152478)

3 weeks agogh-152635: Raise MemoryError when the lock allocation fails in `_interpchannels.creat...
Steve Stagg [Tue, 30 Jun 2026 10:57:28 +0000 (11:57 +0100)] 
gh-152635: Raise MemoryError when the lock allocation fails in `_interpchannels.create()` (#152642)

Previously, an allocation failure when creating
the lock for a channel in `_interpchannels` would trigger an assert.
Caused by `handle_channel_error` being passed an error code of -1
which is only allowed if an exception has been set.
(in this case, no exception was set)

`channelsmod_create` now forwards the error code from `channel_create`
which `handle_channel_error` already handled.

Co-authored-by: sobolevn <mail@sobolevn.me>
3 weeks agogh-151029: Fix `test_remote_exec_deleted_static_executable` on static installed build...
Stan Ulbrych [Tue, 30 Jun 2026 10:40:16 +0000 (12:40 +0200)] 
gh-151029: Fix `test_remote_exec_deleted_static_executable` on static installed builds (GH-152653)

3 weeks agogh-121249: Deprecate using F/D type codes in the struct module (#152309)
Sergey B Kirpichev [Tue, 30 Jun 2026 09:57:22 +0000 (12:57 +0300)] 
gh-121249: Deprecate using F/D type codes in the struct module (#152309)

Co-authored-by: Victor Stinner <vstinner@python.org>
3 weeks agogh-152192: Fix JUMP_BACKWARD passing a truncated oparg to the jit tracer (GH-152382)
Timofei [Tue, 30 Jun 2026 09:46:59 +0000 (12:46 +0300)] 
gh-152192: Fix JUMP_BACKWARD passing a truncated oparg to the jit tracer (GH-152382)

3 weeks agoDon't require the `_test{internal}capi` modules in `test_monitoring.py` (#152311)
Shahar Naveh [Tue, 30 Jun 2026 09:27:51 +0000 (12:27 +0300)] 
Don't require the `_test{internal}capi` modules in `test_monitoring.py` (#152311)

Co-authored-by: Stan Ulbrych <stan@python.org>
3 weeks agogh-50966: Fix unbounded recursion in turtle drag handlers (GH-152626)
Serhiy Storchaka [Tue, 30 Jun 2026 09:19:43 +0000 (12:19 +0300)] 
gh-50966: Fix unbounded recursion in turtle drag handlers (GH-152626)

TurtleScreenBase._update() redraws with cv.update(), which also reprocesses
input events, so a handler that moves the turtle (such as
screen.ondrag(turtle.goto)) reenters _update() for every queued event until
the interpreter crashes.  A reentrant _update() now only flushes drawing with
update_idletasks().

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-152325: Gate curses.has_mouse() on the ncurses patch level (GH-152652)
Serhiy Storchaka [Tue, 30 Jun 2026 09:09:09 +0000 (12:09 +0300)] 
gh-152325: Gate curses.has_mouse() on the ncurses patch level (GH-152652)

has_mouse() was added to ncurses after the 5.7 release, but the binding
guarded it only with NCURSES_MOUSE_VERSION, which 5.7 already defines, so
the module failed to compile against ncurses 5.7 (such as the system
curses on macOS).  Gate it additionally on NCURSES_EXT_FUNCS, which holds
the library's patch date.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-133510: Add links to more info for the match statement in FAQ anwser (#133511)
xzkdeng [Tue, 30 Jun 2026 09:08:39 +0000 (17:08 +0800)] 
gh-133510: Add links to more info for the match statement in FAQ anwser (#133511)

Co-authored-by: sobolevn <mail@sobolevn.me>
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: Stan Ulbrych <stan@python.org>
3 weeks agogh-152248: Reject a POSIX TZ abbreviation with non-ASCII-letters in pure-Python ...
tonghuaroot (童话) [Tue, 30 Jun 2026 08:27:30 +0000 (16:27 +0800)] 
gh-152248: Reject a POSIX TZ abbreviation with non-ASCII-letters in pure-Python `zoneinfo` (#152249)

Co-authored-by: Stan Ulbrych <stan@python.org>
3 weeks agoUse tkinter wrapper methods instead of raw Tcl calls in turtle and IDLE (GH-152414)
Serhiy Storchaka [Tue, 30 Jun 2026 05:41:40 +0000 (08:41 +0300)] 
Use tkinter wrapper methods instead of raw Tcl calls in turtle and IDLE (GH-152414)

* turtle: wm_attributes(topmost=...);
* idlelib.macosx: winfo_server();
* idlelib tests: after_info().

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-146219: Document reusing a thread state across repeated foreign-thread calls ...
Gregory P. Smith [Tue, 30 Jun 2026 00:05:02 +0000 (17:05 -0700)] 
gh-146219: Document reusing a thread state across repeated foreign-thread calls (GH-146221)

* Document reusing a thread state across repeated foreign-thread calls

Add a subsection under "Non-Python created threads" explaining the
performance cost of creating/destroying a PyThreadState on every
Ensure/Release cycle and showing how to keep one alive for the
thread's lifetime instead.

* add a comma

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
3 weeks agogh-149689: add missing error checks in Parser/action_helpers.c (#149710)
Thomas Kowalski [Mon, 29 Jun 2026 23:18:19 +0000 (01:18 +0200)] 
gh-149689: add missing error checks in Parser/action_helpers.c (#149710)

3 weeks agogh-82312: Further improvement of error messages for generating AST nodes (GH-150912)
Serhiy Storchaka [Mon, 29 Jun 2026 22:03:33 +0000 (01:03 +0300)] 
gh-82312: Further improvement of error messages for generating AST nodes (GH-150912)

This is a follow up of GH-17715.

* Use %T instead of _PyType_Name().
* Add the wrong type name we got for identifier and string.

3 weeks agogh-103878: Return a consistent empty value from cancelled file dialogs (GH-152435)
Serhiy Storchaka [Mon, 29 Jun 2026 20:49:19 +0000 (23:49 +0300)] 
gh-103878: Return a consistent empty value from cancelled file dialogs (GH-152435)

On cancellation Tcl may report the empty result as '', () or b'' depending
on the platform and Tk version. Normalize it so that askopenfilename(),
asksaveasfilename() and askdirectory() always return '' and
askopenfilenames() always returns ().

Open._fixresult() now distinguishes single from multiple results by the
'multiple' option rather than the result type.

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-152492 Allow `OrderedDict.update` to work with `frozendict` (#152494)
da-woods [Mon, 29 Jun 2026 19:54:22 +0000 (20:54 +0100)] 
gh-152492 Allow `OrderedDict.update` to work with `frozendict` (#152494)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
3 weeks agogh-103878: Document that the cancelled file dialog value is only falsy (GH-152429)
Serhiy Storchaka [Mon, 29 Jun 2026 19:52:23 +0000 (22:52 +0300)] 
gh-103878: Document that the cancelled file dialog value is only falsy (GH-152429)

Its exact type (empty string, tuple, list or None) varies between
platforms and Tk versions, so advise testing the result for truth.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agoMicro-optimizations for the statistics module (#152618)
Raymond Hettinger [Mon, 29 Jun 2026 19:12:09 +0000 (14:12 -0500)] 
Micro-optimizations for the statistics module (#152618)

3 weeks agogh-152263: Add curses soft-label-key functions (GH-152264)
Serhiy Storchaka [Mon, 29 Jun 2026 17:57:56 +0000 (20:57 +0300)] 
gh-152263: Add curses soft-label-key functions (GH-152264)

Wrap the X/Open Curses soft-label-key functions: slk_init, slk_set,
slk_label, slk_refresh, slk_noutrefresh, slk_clear, slk_restore,
slk_touch, the chtype attribute functions slk_attron, slk_attroff,
slk_attrset and slk_attr, and the attr_t functions slk_attr_on,
slk_attr_off, slk_attr_set and slk_color.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-152228: Fix an assertion failure in `str.replace` under a limited memory case...
sobolevn [Mon, 29 Jun 2026 16:22:22 +0000 (19:22 +0300)] 
gh-152228: Fix an assertion failure in `str.replace` under a limited memory case (#152229)

3 weeks agogh-151987: Pass filter_function to TarFile._extract_one() during .extract() (GH-151988)
Petr Viktorin [Mon, 29 Jun 2026 15:41:26 +0000 (17:41 +0200)] 
gh-151987: Pass filter_function to TarFile._extract_one() during .extract() (GH-151988)

Co-authored-by: Seth Michael Larson <seth@python.org>
3 weeks agogh-69134: Wait until mapped in keyboard virtual-event tests (GH-152599)
Serhiy Storchaka [Mon, 29 Jun 2026 15:30:23 +0000 (18:30 +0300)] 
gh-69134: Wait until mapped in keyboard virtual-event tests (GH-152599)

test_virtual_events and test_selection_event generate key events after
focus_force().  On Windows these are only delivered once the toplevel is
mapped, so they could be dropped and the test fail.  Wait until the
widget is mapped, as the other GUI tests already do.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-151040: Fix `test_c_stack_unwind` on RISC-V (#152370)
Ivy Xu [Mon, 29 Jun 2026 14:47:21 +0000 (22:47 +0800)] 
gh-151040: Fix `test_c_stack_unwind` on RISC-V (#152370)

3 weeks agogh-152587: Make name and value required in tkinter variable methods (GH-152595)
Serhiy Storchaka [Mon, 29 Jun 2026 14:11:03 +0000 (17:11 +0300)] 
gh-152587: Make name and value required in tkinter variable methods (GH-152595)

The name parameter of Misc.wait_variable(), setvar() and getvar() and the
value parameter of setvar() no longer have default values, which were not
meaningful ('PY_VAR' and '1').

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-133031: Fix test_textbox_edit_wide on a narrow build (GH-152592)
Serhiy Storchaka [Mon, 29 Jun 2026 14:00:21 +0000 (17:00 +0300)] 
gh-133031: Fix test_textbox_edit_wide on a narrow build (GH-152592)

unget_wch() can push only a single-byte character on a narrow build,
so skip the multi-byte cases there.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-152587: Stop documenting bogus default values in tkinter variable methods (GH...
Serhiy Storchaka [Mon, 29 Jun 2026 13:48:10 +0000 (16:48 +0300)] 
gh-152587: Stop documenting bogus default values in tkinter variable methods (GH-152594)

The name parameter of Misc.wait_variable(), setvar() and getvar() and the
value parameter of setvar() should not be optional.  Their default values
('PY_VAR' and '1') are not meaningful and should not be advertised.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-151096: Fix test_embed with split exec prefix (#151288)
Harjoth Khara [Mon, 29 Jun 2026 13:28:18 +0000 (06:28 -0700)] 
gh-151096: Fix test_embed with split exec prefix (#151288)

3 weeks agogh-152584: Reorganize the curses documentation into topic subsections (GH-152583)
Serhiy Storchaka [Mon, 29 Jun 2026 13:15:02 +0000 (16:15 +0300)] 
gh-152584: Reorganize the curses documentation into topic subsections (GH-152583)

Reorganize the curses documentation into topic subsections

Group the module-level functions, window methods and constants by topic
instead of presenting them as flat alphabetical lists, following the
categories used by the ncurses manual pages.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-151483: Only declare `PyCodeObject._co_unique_id` on Free Threading (#151484)
Xiaowei Lu [Mon, 29 Jun 2026 13:04:28 +0000 (21:04 +0800)] 
gh-151483: Only declare `PyCodeObject._co_unique_id` on Free Threading (#151484)

3 weeks agogh-152503: Fix garbage text from curses wide-character cell reads (GH-152505)
Serhiy Storchaka [Mon, 29 Jun 2026 12:06:47 +0000 (15:06 +0300)] 
gh-152503: Fix garbage text from curses wide-character cell reads (GH-152505)

window.in_wch(), window.in_wchstr() and window.getbkgrnd() read a cell
into an uninitialized cchar_t, relying on the curses library to leave the
text NUL-terminated -- which ncurses does but X/Open does not require, so
some libraries (such as NetBSD curses) returned uninitialized bytes as
wide characters.  Zero-initialize the cell buffers before the read and
default the getcchar() output to an empty string.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-152502: Detect optional curses functions with configure probes (GH-152504)
Serhiy Storchaka [Mon, 29 Jun 2026 12:02:12 +0000 (15:02 +0300)] 
gh-152502: Detect optional curses functions with configure probes (GH-152504)

Some curses functions were called unconditionally or gated only by the
ncurses-specific NCURSES_EXT_FUNCS macro, which broke building the module
against other curses implementations (narrow ncurses, NetBSD curses) even
when they provided the function.  Detect each with a configure capability
probe and gate on HAVE_CURSES_*.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-152359: Update numbers.rst to reference numeric-hash docs (#152549)
Paper Moon [Mon, 29 Jun 2026 09:56:41 +0000 (17:56 +0800)] 
gh-152359: Update numbers.rst to reference numeric-hash docs (#152549)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
3 weeks agogh-152240: Fix test_c_stack_unwind on Linux LoongArch builds (#152241)
yzewei [Mon, 29 Jun 2026 09:48:05 +0000 (17:48 +0800)] 
gh-152240: Fix test_c_stack_unwind on Linux LoongArch builds (#152241)

3 weeks agogh-71450: Document that Tcl sets the HOME variable on Windows (GH-152568)
Serhiy Storchaka [Mon, 29 Jun 2026 09:35:24 +0000 (12:35 +0300)] 
gh-71450: Document that Tcl sets the HOME variable on Windows (GH-152568)

Also fix the ntpath.expanduser() docstring, which no longer uses $HOME.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
3 weeks agogh-148909: Fix broken author attribution URL in 'The Python 2.3 Method Resolution...
Ivy Xu [Mon, 29 Jun 2026 09:27:41 +0000 (17:27 +0800)] 
gh-148909: Fix broken author attribution URL in 'The Python 2.3 Method Resolution Order' doc (#149092)

3 weeks agogh-152375: Fix undefined behaviour in the `INSTRUMENTED_JUMP` macro (#152376)
Stan Ulbrych [Mon, 29 Jun 2026 09:06:04 +0000 (11:06 +0200)] 
gh-152375: Fix undefined behaviour in the `INSTRUMENTED_JUMP` macro (#152376)