Skip to content

Tkinter: Tk 8.7 quotes pathnames in certain error messages #104494

Description

@chrstphrchvz

Tk 8.7 (as of https://core.tcl-lang.org/tk/info/2991150c09f6) adds quotes around window pathnames in a few error messages, including those triggered by two Tkinter tests, causing them to fail:

======================================================================
FAIL: test_pack_configure_in (test.test_tkinter.test_geometry_managers.PackTest.test_pack_configure_in)
----------------------------------------------------------------------
_tkinter.TclError: can't pack ".pack.a" inside itself

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 111, in test_pack_configure_in
    with self.assertRaisesRegex(TclError,
AssertionError: "can't pack .pack.a inside itself" does not match "can't pack ".pack.a" inside itself"

======================================================================
FAIL: test_place_configure_in (test.test_tkinter.test_geometry_managers.PlaceTest.test_place_configure_in)
----------------------------------------------------------------------
_tkinter.TclError: can't place ".!toplevel2.!frame2" relative to itself

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 295, in test_place_configure_in
    with self.assertRaisesRegex(TclError, "can't place %s relative to "
AssertionError: "can't place \.!toplevel2\.!frame2 relative to itself" does not match "can't place ".!toplevel2.!frame2" relative to itself"

Linked PRs

Activity

  1. added a commit that references this issue on May 15, 2023
  2. changed the title [-]Tkinter: Tk 8.7 quotes pathnames in error messages[/-] [+]Tkinter: Tk 8.7 quotes pathnames in certain error messages[/+] on May 15, 2023
  3. terryjreedy commented on May 15, 2023

    @terryjreedy
    Member

    I have asked on the triager-coredev discord whether these prevent-future-bug issues should be considered enhancements or bugfixes (and eligible to be backported). Even if we decide not an issue for 3.11, this will matter soon for 3.12, when 3.12.0b1 is released (a week?) and 'main' becomes the future 3.13.0.

  4. erlend-aasland commented on May 15, 2023

    @erlend-aasland
    Contributor

    Adjusting tests for Tk 8.7 compatibility is fine. This happens for other extension modules with third party deps as well (for example the sqlite3 module). I'd be fine to backport the test adjustments to 3.11. (3.10 is out of the question, since it only accepts security fixes).

  5. added a commit that references this issue on May 15, 2023
  6. terryjreedy commented on May 15, 2023

    @terryjreedy
    Member

    Some of the adjustments will be to _tkinter or tkinter code, not tests. Example in
    #104496.

  7. terryjreedy commented on May 16, 2023

    @terryjreedy
    Member

    I now agree that we should backport all tests. See new tracking issue #104568. Will immediately backport the PR here.

  8. added a commit that references this issue on May 16, 2023
  9. added a commit that references this issue on May 17, 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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions