Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Tracked by #104568
chrstphrchvz opened this issue May 15, 2023 · 4 comments
Closed
Tracked by #104568

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

chrstphrchvz opened this issue May 15, 2023 · 4 comments

Comments

@chrstphrchvz
Copy link
Contributor

chrstphrchvz commented May 15, 2023

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

chrstphrchvz added a commit to chrstphrchvz/cpython that referenced this issue May 15, 2023
@chrstphrchvz chrstphrchvz changed the title Tkinter: Tk 8.7 quotes pathnames in error messages Tkinter: Tk 8.7 quotes pathnames in certain error messages May 15, 2023
@terryjreedy
Copy link
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.

@erlend-aasland
Copy link
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).

terryjreedy added a commit that referenced this issue May 15, 2023
…104495)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@terryjreedy
Copy link
Member

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

carljm added a commit to carljm/cpython that referenced this issue May 15, 2023
* main: (29 commits)
  pythongh-101819: Fix _io clinic input for unused base class method stubs (python#104418)
  pythongh-101819: Isolate `_io` (python#101948)
  Bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic (python#104501)
  pythongh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (python#104495)
  pythongh-104050: Run mypy on `clinic.py` in CI (python#104421)
  pythongh-104490: Consistently define phony make targets (python#104491)
  pythongh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined (python#104473)
  pythongh-104487: PYTHON_FOR_REGEN must be minimum Python 3.10 (python#104488)
  pythongh-101282: move BOLT config after PGO (pythongh-104493)
  pythongh-104469 Convert _testcapi/float.c to use AC (pythongh-104470)
  pythongh-104456: Fix ref leak in _ctypes.COMError (python#104457)
  pythongh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (python#104474)
  pythongh-104337: Clarify random.gammavariate doc entry  (python#104410)
  Minor improvements to typing docs (python#104465)
  pythongh-87092: avoid gcc warning on uninitialized struct field in assemble.c (python#104460)
  pythonGH-71383: IDLE - Document testing subsets of modules (python#104463)
  pythongh-104454: Fix refleak in AttributeError_reduce (python#104455)
  pythongh-75710: IDLE - add docstrings and comments to editor module (python#104446)
  pythongh-91896: Revert some very noisy DeprecationWarnings for `ByteString` (python#104424)
  Add a mention of PYTHONBREAKPOINT to breakpoint() docs (python#104430)
  ...
carljm added a commit to carljm/cpython that referenced this issue May 15, 2023
* main: (204 commits)
  pythongh-101819: Fix _io clinic input for unused base class method stubs (python#104418)
  pythongh-101819: Isolate `_io` (python#101948)
  Bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic (python#104501)
  pythongh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (python#104495)
  pythongh-104050: Run mypy on `clinic.py` in CI (python#104421)
  pythongh-104490: Consistently define phony make targets (python#104491)
  pythongh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined (python#104473)
  pythongh-104487: PYTHON_FOR_REGEN must be minimum Python 3.10 (python#104488)
  pythongh-101282: move BOLT config after PGO (pythongh-104493)
  pythongh-104469 Convert _testcapi/float.c to use AC (pythongh-104470)
  pythongh-104456: Fix ref leak in _ctypes.COMError (python#104457)
  pythongh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (python#104474)
  pythongh-104337: Clarify random.gammavariate doc entry  (python#104410)
  Minor improvements to typing docs (python#104465)
  pythongh-87092: avoid gcc warning on uninitialized struct field in assemble.c (python#104460)
  pythonGH-71383: IDLE - Document testing subsets of modules (python#104463)
  pythongh-104454: Fix refleak in AttributeError_reduce (python#104455)
  pythongh-75710: IDLE - add docstrings and comments to editor module (python#104446)
  pythongh-91896: Revert some very noisy DeprecationWarnings for `ByteString` (python#104424)
  Add a mention of PYTHONBREAKPOINT to breakpoint() docs (python#104430)
  ...
@terryjreedy
Copy link
Member

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

miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 16, 2023
…rrors (pythonGH-104495)

(cherry picked from commit 3cba61f)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
terryjreedy added a commit that referenced this issue May 17, 2023
…errors (GH-104495) (#104569)

gh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (GH-104495)
(cherry picked from commit 3cba61f)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants