-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Eliminate 'ThemeChanged' warning when running IDLE tests #71383
Comments
When running "python_d.exe -m test_idle from console or when running test file from IDLE after starting it in either console or by import, the following sometimes appears. can't invoke "event" command: application has been destroyed Serhiy, this is pobably not critical, but it is annoying. Perhaps the 'kill-callbacks' patch would fix this. Still, I try to have IDLE tests cleanup properly. Known repeatable occurrences:
|
This looks as a duplicate of bpo-20567. |
New changeset 0207c6203f84 by Terry Jan Reedy in branch '3.5': New changeset 2d864ac472f0 by Terry Jan Reedy in branch 'default': |
I closed bpo-20567 after finishing what I intended to do 3 years ago. I decided make this a separate issue for trying Serhiy's suggestion of updata_idletasks. Pursuing 'no default root' is bpo-24137. 3 other files also gave the warning, once, when run alone. 2 of the 4 'warned with the test suite in 3.5 and 3 of 4 in 3.6. Adding root.update or root.update_idletasks to all 4 fixed all warnings I know of for both versions. It appears to be a coincidence that the warnings consistently appeared where they did. I also added a note about this fix to README.txt. There is no known problem in 2.7. I fixed 3.5 also because the warnings sometimes appear in buildbot reports, and they don't need the noise. |
FWIW, I'm still seeing these errors on OS X (10.11.5 with ActiveTcl 8.5.18) using 2.7.12rc1, 3.5.2rc1, and top-of-trunk 3.6.0. They do not occur on the same platform when using 2.7.11 or 3.5.1. For example: $ /usr/local/bin/python3.5
Python 3.5.2rc1 (v3.5.2rc1:68feec6488b2, Jun 11 2016, 21:59:53)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin [...]
$ /usr/local/bin/python3.5 -m test.regrtest -ugui test_idle
[1/1] test_idle
can't invoke "event" command: application has been destroyed
while executing
"event generate $w <<ThemeChanged>>"
(procedure "ttk::ThemeChanged" line 6)
invoked from within
"ttk::ThemeChanged"
1 test OK.
$ ./bin/python3.6
Python 3.6.0a2+ (default, Jun 19 2016, 13:19:06)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.29)] on darwin [...]
$ ./bin/python3.6 -m test -ugui -j3 test_idle
Run tests in parallel using 3 child processes
0:00:02 [1/1] test_idle passed
can't invoke "event" command: application has been destroyed
while executing
"event generate $w <<ThemeChanged>>"
(procedure "ttk::ThemeChanged" line 6)
invoked from within
"ttk::ThemeChanged"
1 test OK.
Total duration: 0:00:03 |
The only thing I still see is a pair of ThemeChanged warnings from 2.7. Using binary search, I identified test_editmenu as the culprit. This in spite of all the cleanup I can think of @classmethod
def tearDownClass(cls):
del cls.text, cls.entry, cls.spin
cls.root.clipboard_clear()
cls.root.update_idletasks()
cls.root.update()
cls.root.destroy()
del cls.root When I tried to determine which test method(s) gave the warning, as disable all to make sure the warnings vanished, which then did. But after re-enabling, the warnings did not come back -- until they did after a few more runs. I suspect that the only permanent solution will be Serhiy's patch to have .destroy cancel pending callbacks. |
2.7 EOL. Ned, do you still see Themed Changed? I don't on 3.8 on Macbook. with 10.14 mohave(?) |
Based on the error message, I believe this is a known upstream Tk issue (edit: which will be fixed in Tk 8.6.14): https://core.tcl-lang.org/tk/info/2958768, https://core.tcl-lang.org/tk/info/310c74ecf440 |
The 2010-date tcl-tk ticket says that this is known when "an interpreter is created and then immediately destroyed". Last reproduced in Sept 2022 with 8.6 on Win 10. I believe I have seen without immediate close, but will see if possible. I currently see 3 with The above is not directly useful as the current glitches disappear when running 1 test file. I discovered that the first appears when test_history, test_hyperparser, and test_iomenu are run together, but not when iomenu or the other two are run separately. My next PR will be to update the 2 master test files and add a comment in idle_test.init on how to run subsets. |
Tcl/Tk has since merged a fix which will appear in 8.6.14. However, a patch for the fix is small and should apply cleanly to the past few Tk releases. Is Python opposed to backporting accepted fixes for its bundled Tcl/Tk? |
…104463) (cherry picked from commit 080a596) Co-authored-by: Terry Jan Reedy <[email protected]>
When would you expect 8.6.14? |
The past 6 Tcl/Tk 8.6.x releases were around November each year, when the release manager got around to doing so and after any critical fixes were made to Tk Aqua for the latest macOS. So I would guess 8.6.14 is still several months away. |
This error is an annoyance particularly for Tkinter users (see e.g. python/cpython#71383); it will be fixed in Tk 8.6.14.
* 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) ...
* 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) ...
I have opened #108806 and python/cpython-source-deps#29 in case Python is interested in applying the upstream fix to the bundled Tcl/Tk 8.6.8 and 8.6.13 in the macOS and Windows installers. |
Add upstream Tk patches for three problems affecting tkinter users: - Update macOS installer to include a fix accepted by upstream Tcl/Tk for a crash encountered after the first :meth:`tkinter.Tk` instance is destroyed. (gh-92603) - Update macOS installer to include an upstream Tcl/Tk fix for the ``ttk::ThemeChanged`` error encountered in Tkinter. (gh-71383) - Update macOS installer to include an upstream Tcl/Tk fix for the ``Secure coding is not enabled for restorable state!`` warning encountered in Tkinter on macOS 14 Sonoma. (gh-110950) Co-authored-by: Ned Deily <[email protected]>
…111041) Add upstream Tk patches for three problems affecting tkinter users: - Update macOS installer to include a fix accepted by upstream Tcl/Tk for a crash encountered after the first :meth:`tkinter.Tk` instance is destroyed. (pythongh-92603) - Update macOS installer to include an upstream Tcl/Tk fix for the ``ttk::ThemeChanged`` error encountered in Tkinter. (pythongh-71383) - Update macOS installer to include an upstream Tcl/Tk fix for the ``Secure coding is not enabled for restorable state!`` warning encountered in Tkinter on macOS 14 Sonoma. (pythongh-110950) (cherry picked from commit d67f947) Co-authored-by: Christopher Chavez <[email protected]> Co-authored-by: Ned Deily <[email protected]>
…111041) Add upstream Tk patches for three problems affecting tkinter users: - Update macOS installer to include a fix accepted by upstream Tcl/Tk for a crash encountered after the first :meth:`tkinter.Tk` instance is destroyed. (pythongh-92603) - Update macOS installer to include an upstream Tcl/Tk fix for the ``ttk::ThemeChanged`` error encountered in Tkinter. (pythongh-71383) - Update macOS installer to include an upstream Tcl/Tk fix for the ``Secure coding is not enabled for restorable state!`` warning encountered in Tkinter on macOS 14 Sonoma. (pythongh-110950) (cherry picked from commit d67f947) Co-authored-by: Christopher Chavez <[email protected]> Co-authored-by: Ned Deily <[email protected]>
… (#112293) Add upstream Tk patches for three problems affecting tkinter users: - Update macOS installer to include a fix accepted by upstream Tcl/Tk for a crash encountered after the first :meth:`tkinter.Tk` instance is destroyed. (gh-92603) - Update macOS installer to include an upstream Tcl/Tk fix for the ``ttk::ThemeChanged`` error encountered in Tkinter. (gh-71383) - Update macOS installer to include an upstream Tcl/Tk fix for the ``Secure coding is not enabled for restorable state!`` warning encountered in Tkinter on macOS 14 Sonoma. (gh-110950) (cherry picked from commit d67f947) Co-authored-by: Christopher Chavez <[email protected]> Co-authored-by: Ned Deily <[email protected]>
… (#112294) Add upstream Tk patches for three problems affecting tkinter users: - Update macOS installer to include a fix accepted by upstream Tcl/Tk for a crash encountered after the first :meth:`tkinter.Tk` instance is destroyed. (gh-92603) - Update macOS installer to include an upstream Tcl/Tk fix for the ``ttk::ThemeChanged`` error encountered in Tkinter. (gh-71383) - Update macOS installer to include an upstream Tcl/Tk fix for the ``Secure coding is not enabled for restorable state!`` warning encountered in Tkinter on macOS 14 Sonoma. (gh-110950) (cherry picked from commit d67f947) Co-authored-by: Christopher Chavez <[email protected]> Co-authored-by: Ned Deily <[email protected]>
Thanks for the PRs. The fix for Tk in the macOS installer has now been merged for release in 3.13.0a2, 3.12.1, and 3.11.7. |
… containing a targeted upstream fix
…ining a targeted upstream fix (GH-112973)
Windows fix is now committed for 3.13. As discussed elsewhere, I'm not comfortable backporting the patched build to 3.12 or earlier without someone present to promptly debug and fix any issues that arise. |
Unless Serhiy wants to do the Windows backports, I am happy to have this closed. I currently cannot repeat the problems on 3.11/12 Windows I reported last May in #71383 (comment). (This is not the first time the messages have appeared and disappeared.) And the patch should prevent any future appearances. If something reappears in 3.12, I now know not to waste more time trying to make it go away. If something reappears in main after this patch, it should be a new issue. |
…111041) Add upstream Tk patches for three problems affecting tkinter users: - Update macOS installer to include a fix accepted by upstream Tcl/Tk for a crash encountered after the first :meth:`tkinter.Tk` instance is destroyed. (pythongh-92603) - Update macOS installer to include an upstream Tcl/Tk fix for the ``ttk::ThemeChanged`` error encountered in Tkinter. (pythongh-71383) - Update macOS installer to include an upstream Tcl/Tk fix for the ``Secure coding is not enabled for restorable state!`` warning encountered in Tkinter on macOS 14 Sonoma. (pythongh-110950) Co-authored-by: Ned Deily <[email protected]>
… containing a targeted upstream fix (pythonGH-112973)
…111041) Add upstream Tk patches for three problems affecting tkinter users: - Update macOS installer to include a fix accepted by upstream Tcl/Tk for a crash encountered after the first :meth:`tkinter.Tk` instance is destroyed. (pythongh-92603) - Update macOS installer to include an upstream Tcl/Tk fix for the ``ttk::ThemeChanged`` error encountered in Tkinter. (pythongh-71383) - Update macOS installer to include an upstream Tcl/Tk fix for the ``Secure coding is not enabled for restorable state!`` warning encountered in Tkinter on macOS 14 Sonoma. (pythongh-110950) Co-authored-by: Ned Deily <[email protected]>
… containing a targeted upstream fix (pythonGH-112973)
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: