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 — Certain Tkinter tests fail on Tk 8.7 due to TIP 577 · Issue #104855 · python/cpython

Certain Tkinter tests fail on Tk 8.7 due to TIP 577 #104855

New issue
Copy link
New issue
Copy link
Closed
Closed
Certain Tkinter tests fail on Tk 8.7 due to TIP 577#104855
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 24, 2023
Issue body actions

One of the broader effects of TIP 577 on Tk 8.7 (and to a greater degree under Tcl 9.0 than Tcl 8.7) is that it makes widget commands/options/etc. more consistent about using empty string as the reserved “none” value, rather than e.g. "none" or -1. #103685 was one instance of this.

Several options already accepted the empty string under Tk 8.6, but this was not reflected in the bad option… error messages. Tk 8.7 corrects this, which breaks several Tkinter tests with hardcoded error messages:

======================================================================
FAIL: test_place_configure_relheight (test.test_tkinter.test_geometry_managers.PlaceTest.test_place_configure_relheight)
----------------------------------------------------------------------
_tkinter.TclError: expected floating-point number or "" but got "abcd"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/test_geometry_managers.py", line 426, in test_place_configure_relheight
    with self.assertRaisesRegex(TclError, 'expected floating-point number '
AssertionError: "expected floating-point number but got "abcd"" does not match "expected floating-point number or "" but got "abcd""

======================================================================
FAIL: test_place_configure_relwidth (test.test_tkinter.test_geometry_managers.PlaceTest.test_place_configure_relwidth)
----------------------------------------------------------------------
_tkinter.TclError: expected floating-point number or "" but got "abcd"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/test_geometry_managers.py", line 414, in test_place_configure_relwidth
    with self.assertRaisesRegex(TclError, 'expected floating-point number '
AssertionError: "expected floating-point number but got "abcd"" does not match "expected floating-point number or "" but got "abcd""

======================================================================
FAIL: test_configure_overrelief (test.test_tkinter.test_widgets.ButtonTest.test_configure_overrelief)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 448, in test_configure_overrelief
    self.checkReliefParam(widget, 'overrelief')
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 161, in checkReliefParam
    self.checkInvalidParam(widget, name, 'spam',
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 63, in checkInvalidParam
    self.assertEqual(str(cm.exception), errmsg)
AssertionError: 'bad relief "spam": must be flat, groove, raised, ridge, solid, sunken, or ""' != 'bad relief "spam": must be flat, groove, raised, ridge, solid, or sunken'
- bad relief "spam": must be flat, groove, raised, ridge, solid, sunken, or ""
?                                                                      -------
+ bad relief "spam": must be flat, groove, raised, ridge, solid, or sunken
?                                                                +++

======================================================================
FAIL: test_configure_overrelief (test.test_tkinter.test_widgets.CheckbuttonTest.test_configure_overrelief)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 448, in test_configure_overrelief
    self.checkReliefParam(widget, 'overrelief')
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 161, in checkReliefParam
    self.checkInvalidParam(widget, name, 'spam',
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 63, in checkInvalidParam
    self.assertEqual(str(cm.exception), errmsg)
AssertionError: 'bad relief "spam": must be flat, groove, raised, ridge, solid, sunken, or ""' != 'bad relief "spam": must be flat, groove, raised, ridge, solid, or sunken'
- bad relief "spam": must be flat, groove, raised, ridge, solid, sunken, or ""
?                                                                      -------
+ bad relief "spam": must be flat, groove, raised, ridge, solid, or sunken
?                                                                +++

======================================================================
FAIL: test_configure_proxyrelief (test.test_tkinter.test_widgets.PanedWindowTest.test_configure_proxyrelief)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/support.py", line 94, in newtest
    test(self)
  File "/Users/user/git/cpython/Lib/test/test_tkinter/test_widgets.py", line 1245, in test_configure_proxyrelief
    self.checkReliefParam(widget, 'proxyrelief')
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 161, in checkReliefParam
    self.checkInvalidParam(widget, name, 'spam',
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 63, in checkInvalidParam
    self.assertEqual(str(cm.exception), errmsg)
AssertionError: 'bad relief "spam": must be flat, groove, raised, ridge, solid, sunken, or ""' != 'bad relief "spam": must be flat, groove, raised, ridge, solid, or sunken'
- bad relief "spam": must be flat, groove, raised, ridge, solid, sunken, or ""
?                                                                      -------
+ bad relief "spam": must be flat, groove, raised, ridge, solid, or sunken
?                                                                +++

======================================================================
FAIL: test_configure_overrelief (test.test_tkinter.test_widgets.RadiobuttonTest.test_configure_overrelief)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 448, in test_configure_overrelief
    self.checkReliefParam(widget, 'overrelief')
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 161, in checkReliefParam
    self.checkInvalidParam(widget, name, 'spam',
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 63, in checkInvalidParam
    self.assertEqual(str(cm.exception), errmsg)
AssertionError: 'bad relief "spam": must be flat, groove, raised, ridge, solid, sunken, or ""' != 'bad relief "spam": must be flat, groove, raised, ridge, solid, or sunken'
- bad relief "spam": must be flat, groove, raised, ridge, solid, sunken, or ""
?                                                                      -------
+ bad relief "spam": must be flat, groove, raised, ridge, solid, or sunken
?                                                                +++

In a few other cases, empty string has become a valid input, so tests which expect an exception to be raised now fail instead:

======================================================================
FAIL: test_configure_underline (test.test_tkinter.test_widgets.ButtonTest.test_configure_underline)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 418, in test_configure_underline
    self.checkIntegerParam(widget, 'underline', 0, 1, 10)
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 77, in checkIntegerParam
    self.checkInvalidParam(widget, name, '',
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 60, in checkInvalidParam
    with self.assertRaises(tkinter.TclError) as cm:
AssertionError: TclError not raised

======================================================================
FAIL: test_configure_underline (test.test_tkinter.test_widgets.CheckbuttonTest.test_configure_underline)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 418, in test_configure_underline
    self.checkIntegerParam(widget, 'underline', 0, 1, 10)
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 77, in checkIntegerParam
    self.checkInvalidParam(widget, name, '',
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 60, in checkInvalidParam
    with self.assertRaises(tkinter.TclError) as cm:
AssertionError: TclError not raised

======================================================================
FAIL: test_configure_underline (test.test_tkinter.test_widgets.LabelTest.test_configure_underline)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 418, in test_configure_underline
    self.checkIntegerParam(widget, 'underline', 0, 1, 10)
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 77, in checkIntegerParam
    self.checkInvalidParam(widget, name, '',
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 60, in checkInvalidParam
    with self.assertRaises(tkinter.TclError) as cm:
AssertionError: TclError not raised

======================================================================
FAIL: test_configure_underline (test.test_tkinter.test_widgets.MenubuttonTest.test_configure_underline)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 418, in test_configure_underline
    self.checkIntegerParam(widget, 'underline', 0, 1, 10)
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 77, in checkIntegerParam
    self.checkInvalidParam(widget, name, '',
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 60, in checkInvalidParam
    with self.assertRaises(tkinter.TclError) as cm:
AssertionError: TclError not raised

======================================================================
FAIL: test_configure_underline (test.test_tkinter.test_widgets.OptionMenuTest.test_configure_underline)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 418, in test_configure_underline
    self.checkIntegerParam(widget, 'underline', 0, 1, 10)
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 77, in checkIntegerParam
    self.checkInvalidParam(widget, name, '',
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 60, in checkInvalidParam
    with self.assertRaises(tkinter.TclError) as cm:
AssertionError: TclError not raised

======================================================================
FAIL: test_configure_underline (test.test_tkinter.test_widgets.RadiobuttonTest.test_configure_underline)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 418, in test_configure_underline
    self.checkIntegerParam(widget, 'underline', 0, 1, 10)
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 77, in checkIntegerParam
    self.checkInvalidParam(widget, name, '',
  File "/Users/user/git/cpython/Lib/test/test_tkinter/widget_tests.py", line 60, in checkInvalidParam
    with self.assertRaises(tkinter.TclError) as cm:
AssertionError: TclError not raised

Linked PRs

  • gh-104855: Update more tk tests for 8.7 #105047
  • gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 #120824
  • [3.13] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824) #120864
  • [3.12] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824) #120865

Activity

  1. chrstphrchvz
    changed the title [-]Tkinter tests broken on Tk 8.7 due to TIP 577[/-] [+]Tkinter tests fail on Tk 8.7 due to TIP 577[/+] on May 24, 2023
  2. chrstphrchvz
    changed the title [-]Tkinter tests fail on Tk 8.7 due to TIP 577[/-] [+]Certain Tkinter tests fail on Tk 8.7 due to TIP 577[/+] on May 24, 2023
  3. terryjreedy
    added
    topic-tkinter
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    on May 24, 2023
  4. terryjreedy
    added a commit that references this issue on May 29, 2023

    pythongh-104855: Update more tk tests for 8.7

    deef967
  5. terryjreedy commented on May 29, 2023

    @terryjreedy
    terryjreedy
    on May 29, 2023
    Member
    More actions

    In the PR, the 4 groups of errors: place error messages, relief error messages, '' not failing, and 'to' < 'from' working (Spinbox), required fixes in 4 places in 3 files. Where applicable, new success tests were added.

  6. serhiy-storchaka commented on May 31, 2024

    @serhiy-storchaka
    serhiy-storchaka
    on May 31, 2024
    Member
    More actions

    test_keys is failed due to the Tk bug: https://core.tcl-lang.org/tk/tktview/e64820c1dea2ffe69ae7d704dd48fa0098e7ad84

    test_pane and test_forget crash due to the Tk bug: https://core.tcl-lang.org/tk/tktview/e6140f34047ea6f62a9aa636ae73dfe09bb6dafb

  7. serhiy-storchaka
    added a commit that references this issue on Jun 22, 2024

    gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824)

    6ad26de
  8. miss-islington
    added 2 commits that reference this issue on Jun 22, 2024

    pythongh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (pythonG…

    c94ecb7

    pythongh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (pythonG…

    cf8601a
  9. serhiy-storchaka commented on Jun 22, 2024

    @serhiy-storchaka
    serhiy-storchaka
    on Jun 22, 2024
    Member
    More actions

    The above bugs were fixed in Tcl/Tk. Many other changes were made in Tcl/Tk, and will be made before release. I merged test changes which make the Tkinter tests compatible with the current developing version of Tcl/Tk, although it is expected that more changes will be needed for the final version. But this allows us to run tests and see if something more serious were broken (like the bugs mentioned above).

  10. serhiy-storchaka
    added a commit that references this issue on Jun 22, 2024

    [3.12] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824

    f1acb3a
  11. serhiy-storchaka
    closed this as completedon Jun 22, 2024
  12. serhiy-storchaka
    added a commit that references this issue on Jun 22, 2024

    [3.13] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824

    4fabbf9
  13. mrahtz
    added a commit that references this issue on Jun 30, 2024

    pythongh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (pythonG…

    762beb8
  14. estyxx
    added a commit that references this issue on Jul 17, 2024

    pythongh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (pythonG…

    313057b
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.