Skip to content

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

Open

Description

@vstinner

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

Example of failed build: https://github.com/python/cpython/actions/runs/38874850453/job/116887409891?pr=159515.

test.pythoninfo after:

tkinter.TCL_VERSION: 9.1
tkinter.TK_VERSION: 9.1
tkinter.info_patchlevel: 9.1.0

Previous build when the tests passed: https://github.com/python/cpython/actions/runs/38680918836/job/116256273820

test.pythoninfo before:

tkinter.TCL_VERSION: 9.0
tkinter.TK_VERSION: 9.0
tkinter.info_patchlevel: 9.0.4

Linked PRs

Activity

  1. vstinner commented on Oct 16, 2026

    @vstinner
    MemberAuthor

    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

  2. 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
  3. 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
  4. added 3 commits that reference this issue on Oct 16, 2026
  5. serhiy-storchaka commented on Oct 16, 2026

    @serhiy-storchaka
    Member

    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.

  6. vstinner commented on Oct 16, 2026

    @vstinner
    MemberAuthor

    Thank you, @vstinner.

    You're welcome.

    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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions