Skip to content

[3.13] gh-156896: Stop scrubbing tkinter submodules upon idlelib.run import (GH-156915) - #156960

Merged
terryjreedy merged 1 commit into
python:3.13from
serhiy-storchaka:backport-e50d233-3.13
Sep 4, 2026
Merged

[3.13] gh-156896: Stop scrubbing tkinter submodules upon idlelib.run import (GH-156915)#156960
terryjreedy merged 1 commit into
python:3.13from
serhiy-storchaka:backport-e50d233-3.13

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Sep 4, 2026

Copy link
Copy Markdown
Member

Instead, invoke the scrubbing within run.main, which is called after the import when starting the IDLE user process.

This also includes the idlelib.run part of GH-152036, which was not backported and which the scrubbing code in main is based on: missing tkinter submodules are tolerated rather than assuming a fixed set. Lib/idlelib/run.py is now identical in main, 3.15, 3.14 and 3.13.

(cherry picked from commit e50d233)

Co-authored-by: Terry Jan Reedy tjreedy@udel.edu

…mport (python#156915)

Instead, invoke the scrubbing within run.main, which is called after
the import when starting the IDLE user process.

To manually test that scrub_tkinter_submodules
is called when proper, start (or restart) Shell, enter
`import tkinter; dir(tkinter), and check that that font,
messagebox, ttk, and the dialog modules are missing.

It is obvious from the code that the function is not otherwise
called.  To test anyway, continue with `import tkinter.ttk;
import idlelib.run; tkinter.ttk` and check for proper output.

(cherry picked from commit e50d233)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants