Skip to content

[3.13] gh-128846: Make tkinter tests robust against Tcl/Tk 9.0#153484

Open
serhiy-storchaka wants to merge 1 commit into
python:3.13from
serhiy-storchaka:backport-tk9-tests-3.13
Open

[3.13] gh-128846: Make tkinter tests robust against Tcl/Tk 9.0#153484
serhiy-storchaka wants to merge 1 commit into
python:3.13from
serhiy-storchaka:backport-tk9-tests-3.13

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Backport the test-only parts of the Tcl/Tk 8.7/9.0/9.1 test adaptations so that test_tkinter and test_ttk pass when Python 3.13 is built against Tcl/Tk 9.0 or 9.1 (for example the Homebrew build used on macOS — see gh-128846), while still passing against the Tcl/Tk 8.6 that 3.13 ships.

These adaptations were made during 3.14/3.15 development and never backported to 3.13, so building 3.13 against Tk 9.0 currently produces ~90 spurious test_tkinter failures and several test_ttk failures (error-message wording such as doesn'tdoes not and can'tcannot find busy window, pixel rounding/scaling, clipped negative sizes, identify() returning padding instead of focus, etc.).

This combines the test changes from:

The corresponding non-test changes (Modules/_tkinter.c, Lib/tkinter/ttk.py, PCbuild and CI configuration) are not backported. The \z regular-expression escape introduced by gh-133306 is not available in the 3.13 re module, so \Z is kept.

The NotebookTest.test_traversal hardening is handled separately by GH-153415 (already merged) and is not part of this PR.

Verified locally against Tcl/Tk 8.6, 9.0.4 and 9.1b1 (the affected test_tkinter and test_ttk methods pass on all three); the set of collected test cases is unchanged, so no test coverage is dropped.

Backport the test-only parts of the Tcl/Tk 8.7/9.0/9.1 test adaptations so
that test_tkinter and test_ttk pass when Python 3.13 is built against
Tcl/Tk 9.0 (for example the Homebrew build used on macOS), while still
passing against the Tcl/Tk 8.6 that 3.13 ships.

Combines the test changes from:

* pythongh-124111: Update tkinter for compatibility with Tcl/Tk 9.0.0 (pythonGH-124156)
* pythongh-124111: test macOS CI with Tk 9 (pythonGH-137424)
* pythongh-145736: Fix Tkinter tests for Tk 8.7, 9.0 and 9.1 (pythonGH-145738)

The corresponding non-test changes (Modules/_tkinter.c, Lib/tkinter/ttk.py,
PCbuild and CI configuration) are not backported.  The \z regular-expression
escape introduced by pythongh-133306 is not available in the 3.13 re module, so
\Z is kept.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant