GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_tkinter failing on MacOS · Issue #128846 · python/cpython

test_tkinter failing on MacOS #128846

New issue
Copy link
New issue
Copy link
Closed
Closed
test_tkinter failing on MacOS#128846
Copy link
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-tkintertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@smontanaro
smontanaro
opened on Jan 14, 2025
Issue body actions

Bug report

Bug description:

test_tkinter is failing on MacOS (Sequoia 15.2, M1 MacBook Pro, in my case). It was working fine yesterday, so without delving into this too deeply, I'm going to suggest this change overnight broke things. See attached log

commit da8825ea95a7096bb4f933d33b212a94ade10f6e
Author: Zhikang Yan <[email protected]>
Date:   Mon Jan 13 23:54:46 2025 +0800

    gh-128562: Fix generation of the tkinter widget names (GH-128604)
    
    There were possible conflicts if the widget class name ends with a digit.

@Xiaokang2022

(FWIW, test_ttk is failing for me on 3.13, but not main. It appears to be a different problem.)

test_tkinter.log

CPython versions tested on:

CPython main branch, 3.13

Operating systems tested on:

macOS

Linked PRs

  • gh-128846: Add check_tk_version function to test.support #128880
  • [3.13] gh-128846: Make tkinter tests robust against Tcl/Tk 9.0 #153484
  • [3.13] gh-128846: Fix test_configure_custom_copy for the aqua theme with Tk 9 #153611

Activity

Next
  1. smontanaro
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jan 14, 2025
  2. zanieb
    added
    testsTests in the Lib/test dirTests in the Lib/test dir
    topic-tkinter
    on Jan 14, 2025
  3. zanieb commented on Jan 14, 2025

    @zanieb
    zanieb
    on Jan 14, 2025
    Contributor
    More actions

    The referenced commit is from #128604 / #128562

  4. zanieb commented on Jan 14, 2025

    @zanieb
    zanieb
    on Jan 14, 2025
    Contributor
    More actions

    I can reproduce this on main / f7ceb31 but reverting da8825e does not resolve the failure.

  5. zanieb commented on Jan 14, 2025

    @zanieb
    zanieb
    on Jan 14, 2025
    Contributor
    More actions

    I also reproduced this on an arbitrary older commit 2fcdc84 (and then b2ac70a)

    If I go back to ce740d4, which I need to run the GUI tests on my machine, I get a bunch of failures — including what looks like the failures reported here. @smontanaro I don't know if it makes sense that these tests worked yesterday.

  6. zanieb commented on Jan 14, 2025

    @zanieb
    zanieb
    on Jan 14, 2025
    Contributor
    More actions

    It looks like this is caused by using tk 9.0+, at least on my machine, Brew upgraded to a new version.

    You can confirm with

    ❯ ./python.exe -c 'import tkinter; tcl = tkinter.Tcl(); print(tcl.call("info", "patchlevel"))'
    9.0.1
    

    In which case, this is part of

    • Update tkinter to use Tk 8.6.15 or (better) Tk 9.0 #124111
    • Prepare tkinter for tcl 8.7/9.0 and tk 8.7 #104568

    I don't think the tests are expected to pass with tk 9 yet.

  7. smontanaro commented on Jan 14, 2025

    @smontanaro
    smontanaro
    on Jan 14, 2025
    ContributorAuthor
    More actions

    Hmmm... This might turn out to be pilot error. I have a config file in my personal build environment which gets Tcl/Tk libs from my Conda env:

    TCLTK_CFLAGS=-I/Users/skip/miniconda3/envs/python312/include
    TCLTK_LIBS='-L/Users/skip/miniconda3/envs/python312/lib -Wl,-rpath,/Users/skip/miniconda3/envs/python312/lib -ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6'
    

    Somehow that was dropped from a command recalled from my bash history, so I was picking up 9.0.1. Now that I've corrected my commands, my build on main works and yields the expected version:

    % ./python.exe -c 'import tkinter; tcl = tkinter.Tcl(); print(tcl.call("info", "patchlevel"))'
    8.6.13
    

    I've yet to pull in the correct command on my 3.13 Terminal window, so it still yields the later version:

    % ./python.exe -c 'import tkinter; tcl = tkinter.Tcl(); print(tcl.call("info", "patchlevel"))'
    9.0.1
    

    Would it be worthwhile running this bit of code in the test suite, then skipping the tests if Tcl/Tk v9 was found?

  8. zanieb commented on Jan 14, 2025

    @zanieb
    zanieb
    on Jan 14, 2025
    Contributor
    More actions

    That seems reasonable to me, but I'd be curious to hear from someone that's a stakeholder for that topic.

  9. sobolevn commented on Jan 15, 2025

    @sobolevn
    sobolevn
    on Jan 15, 2025
    Member
    More actions

    cc @terryjreedy

  10. Xiaokang2022 commented on Jan 15, 2025

    @Xiaokang2022
    Xiaokang2022
    on Jan 15, 2025
    Contributor
    More actions

    This doesn't seem to be the cause of my commit, which passed macOS-related tests.

  11. terryjreedy commented on Jan 15, 2025

    @terryjreedy
    terryjreedy
    on Jan 15, 2025
    Member
    More actions

    @serhiy-storchaka is the tkinter expert, not me. I would like to be able to use 9.0, but I don't know where that stands now.

  12. warsaw commented on Jul 9, 2026

    @warsaw
    warsaw
    on Jul 9, 2026
    Member
    More actions

    FWIW, I see test_tkinter blocking unrelated 3.13 backports, pretty consistently. On a local 3.13 branch, both test_tkinter and test_ttk fail for me consistently too.

    % brew info tcl-tk
    ...
    ==> Installed Versions
    tcl-tk ✔ 9.0.3 (3,158 files, 40MB) [Linked]
    

    For me, they pass on all newer branches.

  13. serhiy-storchaka commented on Jul 9, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on Jul 9, 2026
    Member
    More actions

    test_wm_iconbitmap has separate issue #146531. Other failures are not related to it.

    The original report was 1.5 years ago, there were many changes in tests since then, especially in last month. Please check if the originally reported failure still reproduced (besides test_wm_iconbitmap). I have no Mac, so my capabilities to address Mac-only issues are limited.

  14. warsaw commented on Jul 9, 2026

    @warsaw
    warsaw
    on Jul 9, 2026
    Member
    More actions

    @hugovk "fixed" the timeout, but I still see two actual failures:

    0:01:55 load avg: 6.32 running (1): test_ttk (31.4 sec)
    0:02:25 load avg: 5.86 running (1): test_ttk (1 min 1 sec)
    0:02:55 load avg: 5.26 running (1): test_ttk (1 min 31 sec)
    0:03:05 load avg: 4.90 [4/4/2] test_ttk failed (9 failures) (1 min 40 sec)
    Re-running test_ttk in verbose mode (matching: test_configure_image, test_configure_custom_copy, test_element_create_from_errors, test_configure_image, test_configure_image, test_virtual_event, test_configure_image, test_configure_image, test_configure_image)
    test_configure_image (test.test_ttk.test_extensions.OptionMenuTest.test_configure_image) ... FAIL
    test_configure_custom_copy (test.test_ttk.test_style.StyleTest.test_configure_custom_copy) ...
      test_configure_custom_copy (test.test_ttk.test_style.StyleTest.test_configure_custom_copy) (theme='aqua', name='.') ... FAIL
    test_element_create_from_errors (test.test_ttk.test_style.StyleTest.test_element_create_from_errors) ... FAIL
    test_configure_image (test.test_ttk.test_widgets.ButtonTest.test_configure_image) ... FAIL
    test_configure_image (test.test_ttk.test_widgets.CheckbuttonTest.test_configure_image) ... FAIL
    test_virtual_event (test.test_ttk.test_widgets.ComboboxTest.test_virtual_event) ... FAIL
    test_configure_image (test.test_ttk.test_widgets.LabelTest.test_configure_image) ... FAIL
    test_configure_image (test.test_ttk.test_widgets.MenubuttonTest.test_configure_image) ... FAIL
    test_configure_image (test.test_ttk.test_widgets.RadiobuttonTest.test_configure_image) ... FAIL
    
    ======================================================================
    FAIL: test_configure_image (test.test_ttk.test_extensions.OptionMenuTest.test_configure_image)
    ----------------------------------------------------------------------
    _tkinter.TclError: image "spam" does not exist
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 376, in test_configure_image
        self.checkImageParam(widget, 'image')
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_ttk/test_widgets.py", line 185, in checkImageParam
        self.checkInvalidParam(widget, name, 'spam',
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
                errmsg='image "spam" doesn\'t exist')
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 80, in checkInvalidParam
        with self.assertRaisesRegex(tkinter.TclError, errmsg or ''):
             ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: "\Aimage "spam" doesn't exist\Z" does not match "image "spam" does not exist"
    
    ======================================================================
    FAIL: test_configure_custom_copy (test.test_ttk.test_style.StyleTest.test_configure_custom_copy) (theme='aqua', name='.')
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/barry/projects/python/3.13/Lib/test/test_ttk/test_style.py", line 164, in test_configure_custom_copy
        self.assertEqual(style.configure(newname), default)
        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: {'font': 'TkDefaultFont', 'foreground': 'sy[193 chars]: ''} != {'selectforeground': 'systemSelectedTextCol[193 chars]': 1}
      {'background': 'systemWindowBackgroundColor',
       'font': 'TkDefaultFont',
       'foreground': 'systemLabelColor',
       'insertwidth': 1,
       'selectbackground': 'systemSelectedTextBackgroundColor',
       'selectforeground': 'systemSelectedTextColor',
    -  'stipple': ''}
    ?             ^^
    
    +  'stipple': ()}
    ?             ^^
    
    
    ======================================================================
    FAIL: test_element_create_from_errors (test.test_ttk.test_style.StyleTest.test_element_create_from_errors)
    ----------------------------------------------------------------------
    _tkinter.TclError: theme "spam" does not exist
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/barry/projects/python/3.13/Lib/test/test_ttk/test_style.py", line 225, in test_element_create_from_errors
        with self.assertRaisesRegex(TclError, 'theme "spam" doesn\'t exist'):
             ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: "theme "spam" doesn't exist" does not match "theme "spam" does not exist"
    
    ======================================================================
    FAIL: test_configure_image (test.test_ttk.test_widgets.ButtonTest.test_configure_image)
    ----------------------------------------------------------------------
    _tkinter.TclError: image "spam" does not exist
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 376, in test_configure_image
        self.checkImageParam(widget, 'image')
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_ttk/test_widgets.py", line 185, in checkImageParam
        self.checkInvalidParam(widget, name, 'spam',
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
                errmsg='image "spam" doesn\'t exist')
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 80, in checkInvalidParam
        with self.assertRaisesRegex(tkinter.TclError, errmsg or ''):
             ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: "\Aimage "spam" doesn't exist\Z" does not match "image "spam" does not exist"
    
    ======================================================================
    FAIL: test_configure_image (test.test_ttk.test_widgets.CheckbuttonTest.test_configure_image)
    ----------------------------------------------------------------------
    _tkinter.TclError: image "spam" does not exist
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 376, in test_configure_image
        self.checkImageParam(widget, 'image')
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_ttk/test_widgets.py", line 185, in checkImageParam
        self.checkInvalidParam(widget, name, 'spam',
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
                errmsg='image "spam" doesn\'t exist')
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 80, in checkInvalidParam
        with self.assertRaisesRegex(tkinter.TclError, errmsg or ''):
             ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: "\Aimage "spam" doesn't exist\Z" does not match "image "spam" does not exist"
    
    ======================================================================
    FAIL: test_virtual_event (test.test_ttk.test_widgets.ComboboxTest.test_virtual_event)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/barry/projects/python/3.13/Lib/test/test_ttk/test_widgets.py", line 506, in test_virtual_event
        self.assertTrue(success)
        ~~~~~~~~~~~~~~~^^^^^^^^^
    AssertionError: [] is not true
    
    ======================================================================
    FAIL: test_configure_image (test.test_ttk.test_widgets.LabelTest.test_configure_image)
    ----------------------------------------------------------------------
    _tkinter.TclError: image "spam" does not exist
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 376, in test_configure_image
        self.checkImageParam(widget, 'image')
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_ttk/test_widgets.py", line 185, in checkImageParam
        self.checkInvalidParam(widget, name, 'spam',
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
                errmsg='image "spam" doesn\'t exist')
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 80, in checkInvalidParam
        with self.assertRaisesRegex(tkinter.TclError, errmsg or ''):
             ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: "\Aimage "spam" doesn't exist\Z" does not match "image "spam" does not exist"
    
    ======================================================================
    FAIL: test_configure_image (test.test_ttk.test_widgets.MenubuttonTest.test_configure_image)
    ----------------------------------------------------------------------
    _tkinter.TclError: image "spam" does not exist
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 376, in test_configure_image
        self.checkImageParam(widget, 'image')
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_ttk/test_widgets.py", line 185, in checkImageParam
        self.checkInvalidParam(widget, name, 'spam',
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
                errmsg='image "spam" doesn\'t exist')
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 80, in checkInvalidParam
        with self.assertRaisesRegex(tkinter.TclError, errmsg or ''):
             ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: "\Aimage "spam" doesn't exist\Z" does not match "image "spam" does not exist"
    
    ======================================================================
    FAIL: test_configure_image (test.test_ttk.test_widgets.RadiobuttonTest.test_configure_image)
    ----------------------------------------------------------------------
    _tkinter.TclError: image "spam" does not exist
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 376, in test_configure_image
        self.checkImageParam(widget, 'image')
        ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_ttk/test_widgets.py", line 185, in checkImageParam
        self.checkInvalidParam(widget, name, 'spam',
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
                errmsg='image "spam" doesn\'t exist')
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/barry/projects/python/3.13/Lib/test/test_tkinter/widget_tests.py", line 80, in checkInvalidParam
        with self.assertRaisesRegex(tkinter.TclError, errmsg or ''):
             ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: "\Aimage "spam" doesn't exist\Z" does not match "image "spam" does not exist"
    
    ----------------------------------------------------------------------
    Ran 9 tests in 100.683s
    
    FAILED (failures=9)
    test test_ttk failed
    2 tests failed again:
        test_tkinter test_ttk

    I suspect it's because it's linking against Tcl/Tk 9.0.3 from homebrew and 3.13 isn't compatible with it. I'm not sure it's worth doing anything more in 3.13 given newer branches seem fine.

  15. 2 remaining items

  16. serhiy-storchaka commented on Jul 10, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on Jul 10, 2026
    Member
    More actions

    #153484 does this.

  17. serhiy-storchaka
    added a commit that references this issue on Jul 11, 2026

    [3.13] gh-128846: Make tkinter tests robust against Tcl/Tk 9.0 (GH-15…

    59e183c
  18. smontanaro commented on Jul 11, 2026

    @smontanaro
    smontanaro
    on Jul 11, 2026
    ContributorAuthor
    More actions

    Very close. test_tkinter now passes. There's still a single test case failure in test_ttk:

    FAIL: test_configure_custom_copy (test.test_ttk.test_style.StyleTest.test_configure_custom_copy) (theme='aqua', name='.')
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/skip/src/python/py3.13/Lib/test/test_ttk/test_style.py", line 164, in test_configure_custom_copy
        self.assertEqual(style.configure(newname), default)
        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    AssertionError: {'font': 'TkDefaultFont', 'foreground': 'sy[193 chars]: ''} != {'selectforeground': 'systemSelectedTextCol[193 chars]': 1}
      {'background': 'systemWindowBackgroundColor',
       'font': 'TkDefaultFont',
       'foreground': 'systemLabelColor',
       'insertwidth': 1,
       'selectbackground': 'systemSelectedTextBackgroundColor',
       'selectforeground': 'systemSelectedTextColor',
    -  'stipple': ''}
    ?             ^^
    
    +  'stipple': ()}
    ?             ^^
  19. serhiy-storchaka commented on Jul 12, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on Jul 12, 2026
    Member
    More actions

    Thanks for testing. This is Aqua-specific issue, not reproducible on Linux. Please check if #153611 fixes it.

  20. smontanaro commented on Jul 12, 2026

    @smontanaro
    smontanaro
    on Jul 12, 2026
    ContributorAuthor
    More actions

    Unfortunately, it doesn't. I get the same error after applying your patch:

    % ./python.exe -m test -v -ugui test_ttk
    == CPython 3.13.14+ experimental free-threading build (heads/3.13:caa4be2d497, Jul 11 2026, 16:55:57) [Clang 22.1.8 ]
    == macOS-26.5.2-arm64-arm-64bit-Mach-O little-endian
    == Python build: free_threading release
    == cwd: /Users/skip/src/python/py3.13/build/test_python_worker_2401æ
    == CPU count: 8
    == encodings: locale=UTF-8 FS=utf-8
    == resources (1): gui
    
    Using random seed: 2083467248
    0:00:00 load avg: 3.02 Run 1 test sequentially in a single process
    0:00:00 load avg: 3.02 [1/1] test_ttk
    ...
    ======================================================================
    FAIL: test_configure_custom_copy (test.test_ttk.test_style.StyleTest.test_configure_custom_copy) (theme='aqua', name='.')
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/Users/skip/src/python/py3.13/Lib/test/test_ttk/test_style.py", line 170, in test_configure_custom_copy
        self.assertEqual({k: norm(v) for k, v in copy.items()},
        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                         default)
                         ^^^^^^^^
    AssertionError: {'font': 'TkDefaultFont', 'foreground': 'sy[193 chars]: ''} != {'selectforeground': 'systemSelectedTextCol[193 chars]': 1}
      {'background': 'systemWindowBackgroundColor',
       'font': 'TkDefaultFont',
       'foreground': 'systemLabelColor',
       'insertwidth': 1,
       'selectbackground': 'systemSelectedTextBackgroundColor',
       'selectforeground': 'systemSelectedTextColor',
    -  'stipple': ''}
    ?             ^^
    
    +  'stipple': ()}
    ?             ^^
    
    
    ----------------------------------------------------------------------
    Ran 397 tests in 18.306s
    
    FAILED (failures=1, skipped=15)
    test test_ttk failed
    0:00:18 load avg: 2.79 [1/1/1] test_ttk failed (1 failure)
    
    == Tests result: FAILURE ==
    
    1 test failed:
        test_ttk
    
    Total duration: 18.5 sec
    Total tests: run=397 failures=1 skipped=15
    Total test files: run=1/1 failed=1
    Result: FAILURE
    (py314) ~/src/python/py3.13% git diff
    diff --git a/Lib/test/test_ttk/test_style.py b/Lib/test/test_ttk/test_style.py
    index 56d8a5931fd..2e0a0384dd2 100644
    --- a/Lib/test/test_ttk/test_style.py
    +++ b/Lib/test/test_ttk/test_style.py
    @@ -161,9 +161,17 @@ def test_configure_custom_copy(self):
                         newname = f'C.{name}'
                         self.assertEqual(style.configure(newname), None)
                         style.configure(newname, **default)
    -                    self.assertEqual(style.configure(newname), default)
    +                    # With Tk 9 and the aqua theme an empty option value is
    +                    # read back as an empty tuple rather than an empty string
    +                    # (see gh-128846); normalize before comparing.
    +                    def norm(value):
    +                        return '' if value == () else value
    +                    copy = style.configure(newname)
    +                    self.assertEqual({k: norm(v) for k, v in copy.items()},
    +                                     default)
                         for key, value in default.items():
    -                        self.assertEqual(style.configure(newname, key), value)
    +                        self.assertEqual(norm(style.configure(newname, key)),
    +                                         value)
     
     
         def test_map_custom_copy(self):
    
  21. serhiy-storchaka commented on Jul 12, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on Jul 12, 2026
    Member
    More actions

    What if replace return '' if value == () else value with return () if value == '' else value?

  22. smontanaro commented on Jul 12, 2026

    @smontanaro
    smontanaro
    on Jul 12, 2026
    ContributorAuthor
    More actions

    Yes, that works, thanks...

  23. serhiy-storchaka
    added a commit that references this issue on Jul 14, 2026

    pythongh-128846: Fix the normalization direction in test_configure_cu…

    d41c0e6
  24. serhiy-storchaka commented on Jul 15, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on Jul 15, 2026
    Member
    More actions

    Unfortunately that change breaks CI testing.

  25. serhiy-storchaka
    added 2 commits that reference this issue on Jul 15, 2026

    pythongh-128846: Normalize the default in test_configure_custom_copy

    5e43709

    [3.13] gh-128846: Fix test_configure_custom_copy for the aqua theme w…

    90b33e6
  26. serhiy-storchaka commented on Jul 20, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on Jul 20, 2026
    Member
    More actions

    Please test with the current 3.13 branch.

  27. smontanaro commented on Jul 20, 2026

    @smontanaro
    smontanaro
    on Jul 20, 2026
    ContributorAuthor
    More actions

    Current 3.13 branch tests cleanly. Sorry for not trying sooner. I don't seem to get all pertinent notifications.

  28. serhiy-storchaka commented on Jul 20, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on Jul 20, 2026
    Member
    More actions

    Thank you for verification. I am closing this issue as completed.

  29. serhiy-storchaka
    closed this as completedon Jul 20, 2026
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

    testsTests in the Lib/test dirTests in the Lib/test dirtopic-tkintertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.