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 — Tkinter: Tk 8.7 alphabetizes options in certain error messages · Issue #104497 · python/cpython

Tkinter: Tk 8.7 alphabetizes options in certain error messages #104497

New issue
Copy link
New issue
Copy link
Closed
Closed
Tkinter: Tk 8.7 alphabetizes options in certain error messages#104497
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

@chrstphrchvz
chrstphrchvz
opened on May 15, 2023
Issue body actions

As done by e.g. https://core.tcl-lang.org/tk/info/b7db31b3a38b and causing this Tkinter test to fail:

======================================================================
FAIL: test_configure_type (test.test_tkinter.test_widgets.MenuTest.test_configure_type)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/test_widgets.py", line 1403, in test_configure_type
    self.checkEnumParam(
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 134, in checkEnumParam
    self.checkInvalidParam(widget, name, 'spam', errmsg=errmsg)
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 63, in checkInvalidParam
    self.assertEqual(str(cm.exception), errmsg)
AssertionError: 'bad type "spam": must be menubar, normal, or tearoff' != 'bad type "spam": must be normal, tearoff, or menubar'
- bad type "spam": must be menubar, normal, or tearoff
+ bad type "spam": must be normal, tearoff, or menubar

Linked PRs

  • gh-104497: Make tkinter test pass with tk 8.7 #104789
  • [3.12] gh-104497: Make tkinter test pass with tk 8.7 (GH-104789) #105028
  • [3.11] gh-104497: Make tkinter test pass with tk 8.7 (GH-104789) #105029
Reacted by sunmy2019

Activity

  1. sunmy2019
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    topic-tkinter
    on May 15, 2023
  2. terryjreedy commented on May 15, 2023

    @terryjreedy
    terryjreedy
    on May 15, 2023
    Member
    More actions

    Easy fix would be to change errmsg = ... to errprefix = 'bad type "spam": must be ' and add [:25] to str(...). I am keeping equality check instead of using .startswith to for helpful error message.

  3. sunmy2019 commented on May 15, 2023

    @sunmy2019
    sunmy2019
    on May 15, 2023
    Member
    More actions

    And if you want a little more, you can use

    >>> from collections import Counter
    >>> Counter("1234") == Counter("3412")
    True
  4. terryjreedy commented on May 17, 2023

    @terryjreedy
    terryjreedy
    on May 17, 2023
    Member
    More actions

    @sunmy2019 As near as I can tell from from searching _tkinter.c and tkinter/init.py, the actual error message is from tcl/tk. If so, all that needs testing is that as error is raised with 'spam' in the message. The options in the expected message come from the test itself, so a mismatch would indicate an error in tcl/tk, which we are not trying to test, or in the test, from being overy specific.

    @chrstphrchvz The title and linked tcl issue suggest that multiple messages have been revised. If so, a special case fix for one test would be insufficient.

  5. chrstphrchvz commented on May 20, 2023

    @chrstphrchvz
    chrstphrchvz
    on May 20, 2023
    ContributorAuthor
    More actions

    @chrstphrchvz The title and linked tcl issue suggest that multiple messages have been revised. If so, a special case fix for one test would be insufficient.

    Understood, however this is currently the only test I have found to be affected by alphabetizing changes.

  6. terryjreedy commented on May 22, 2023

    @terryjreedy
    terryjreedy
    on May 22, 2023
    Member
    More actions

    Then I made a PR to fix just that test.

  7. terryjreedy
    added 2 commits that reference this issue on May 23, 2023

    pythongh-104497: Make tkinter test pass with tk 8.7

    ff8f707

    gh-104497: Make tkinter test pass with tk 8.7 (#104789)

    897e716
  8. miss-islington
    added 2 commits that reference this issue on May 27, 2023

    pythongh-104497: Make tkinter test pass with tk 8.7 (pythonGH-104789)

    3fdfdab

    pythongh-104497: Make tkinter test pass with tk 8.7 (pythonGH-104789)

    afe4b8d
  9. terryjreedy
    added 2 commits that reference this issue on May 27, 2023

    [3.12] gh-104497: Make tkinter test pass with tk 8.7 (GH-104789) (#10…

    5426ff1

    [3.11] gh-104497: Make tkinter test pass with tk 8.7 (GH-104789) (#10…

    dcfa816
  10. terryjreedy
    closed this as completedon May 27, 2023
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 01402503 — 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.