On macOS with Python 3.15, test_idle and test_tkinter fail with `_tkinter.TclError: invalid command name "::tk::unsupported::MacWindowStyle"` on Tk/Tcl 9.1 · Issue #159517 · python/cpython · GitHub
On macOS with Python 3.15, test_idle and test_tkinter fail with _tkinter.TclError: invalid command name "::tk::unsupported::MacWindowStyle" on Tk/Tcl 9.1 #159517
Tcl/Tk was recently upgraded from Tcl 9.0/Tk 9.0 to Tcl 9.1/Tk 9.1 on macOS GitHub Action. Since this update, many tests of test_idle and test_tkinter started to fail on "macOS (free-threading) / build and test (macos-26)" (GHA CI) with _tkinter.TclError: invalid command name "::tk::unsupported::MacWindowStyle".
changed the title [-]test_idle and test_tkinter fail with `_tkinter.TclError: invalid command name "::tk::unsupported::MacWindowStyle"` on Tk 9.1/Tcl 9.1[/-][+]On macOS, test_idle and test_tkinter fail with `_tkinter.TclError: invalid command name "::tk::unsupported::MacWindowStyle"` on Tk/Tcl 9.1[/+]on Oct 16, 2026
changed the title [-]On macOS, test_idle and test_tkinter fail with `_tkinter.TclError: invalid command name "::tk::unsupported::MacWindowStyle"` on Tk/Tcl 9.1[/-][+]On macOS with Python 3.15, test_idle and test_tkinter fail with `_tkinter.TclError: invalid command name "::tk::unsupported::MacWindowStyle"` on Tk/Tcl 9.1[/+]on Oct 16, 2026
Thank you, @vstinner. I did not expect CI will use Tcl 9.1/Tk 9.1 so soon, especially on non-main branches. I do not recommend to use 9.1.0. It has many bugs in new features. The next bugfix release will came with their fixes, and also with many fixes of old bugs and important macOS fixes.
#159527 fixes other use of ::tk::unsupported::MacWindowStyle in IDLE.
I did not expect CI will use Tcl 9.1/Tk 9.1 so soon, especially on non-main branches. I do not recommend to use 9.1.0. It has many bugs in new features. The next bugfix release will came with their fixes, and also with many fixes of old bugs and important macOS fixes.
Activity
vstinner commented on Oct 16, 2026
Example of failure:
ERROR: test_open_and_close (idlelib.idle_test.test_searchbase.SearchDialogBaseTest.test_open_and_close) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/runner/work/cpython/cpython/Lib/idlelib/idle_test/test_searchbase.py", line 52, in test_open_and_close self.dialog.open(text) ~~~~~~~~~~~~~~~~^^^^^^ File "/Users/runner/work/cpython/cpython/Lib/idlelib/searchbase.py", line 55, in open self.create_widgets() ~~~~~~~~~~~~~~~~~~~^^ File "/Users/runner/work/cpython/cpython/Lib/idlelib/searchbase.py", line 103, in create_widgets _setup_dialog(top) ~~~~~~~~~~~~~^^^^^ File "/Users/runner/work/cpython/cpython/Lib/tkinter/simpledialog.py", line 265, in _setup_dialog w.tk.call("::tk::unsupported::MacWindowStyle", "style", ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ w, "moveableModal", "") ^^^^^^^^^^^^^^^^^^^^^^^ _tkinter.TclError: invalid command name "::tk::unsupported::MacWindowStyle"cc @terryjreedy @serhiy-storchaka
pythongh-159517: Modernize tkinter.simpledialog
[3.15] gh-159517: Modernize tkinter.simpledialog (#159518)
[3.14] gh-159517: Modernize tkinter.simpledialog (GH-159518) (#159522)
serhiy-storchaka commented on Oct 16, 2026
Thank you, @vstinner. I did not expect CI will use Tcl 9.1/Tk 9.1 so soon, especially on non-main branches. I do not recommend to use 9.1.0. It has many bugs in new features. The next bugfix release will came with their fixes, and also with many fixes of old bugs and important macOS fixes.
#159527 fixes other use of ::tk::unsupported::MacWindowStyle in IDLE.
vstinner commented on Oct 16, 2026
You're welcome.
The failed 3.15 job uses macOS 26 arm image. The surprising thing is that https://github.com/actions/runner-images/blob/main/images/macos/macos-26-arm64-Readme.md still mentions "Tcl/Tk 8.6.18" whereas it was "Tcl/Tk 9.0" a few hours ago, and it's now "Tcl/Tk 9.1". The README is outdated, and I looked at the wrong README :-)
gh-159517: Do not use ::tk::unsupported::MacWindowStyle in IDLE on Tk…
[3.14] gh-159517: Do not use ::tk::unsupported::MacWindowStyle in IDL…
[3.15] gh-159517: Do not use ::tk::unsupported::MacWindowStyle in IDL…
vstinner commented on Oct 18, 2026
Both changes have been merged and backported to stable versions, I close the issue.