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
test_idle causes test_ttk_guionly 'can't invoke "event" command: application has been destroyed' messages from Tk #64766
Comments
Seen with default (3.4.0) framework builds on OS X 10.9 with ActiveTcl 8.5.15.0: ./configure --enable-universalsdk=/ --with-universal-archs=intel --enable-framework=/tmp/t/Library/Frameworks When running test_ttk_guionly by itself (or in combination with a few neighboring tests): /tmp/t/bin/python3.4 -m test -w -uall test_ttk_guionly the message is not seen. I had not seen this behavior prior to somewhere in the 3.4.0 development cycle. |
Could you try test_ttk_guionly after test_all, test_builtins, test_tcl? If the issue is not reproduced, try to use binary search: divide the tests before test_ttk_guionly on to parts, and run tests with one half, then with other. Repeat until found the culprit. |
Threading and subprocess tests also evoke a suspicion. |
$ /usr/local/bin/python3.3 -m test -w -uall test_idle test_ttk_guionly
[1/2] test_idle
[2/2] test_ttk_guionly
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"
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"
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"
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"
All 2 tests OK. |
The combination of just test_idle followed by test_ttk_guionly also produces the "application has been destroyed" messages on Debian Linux and when run from a build directory (e.g. not installed) and with 2.7, 3.3, and default. |
Ned, do you actually *see* this on 2.7, 3.3? The message looks suspiciously like the somewhat strange 3.4-only shutdown message suppressed by bpo-20167. |
Here is a patch which fixes symptoms. Maybe we'll find better solution. These messages are produced when the ttk::ThemeChanged command called from a callback for already destroyed Tk root window. |
Running just the two tests fails on windows also, with all three versions. For 2.7, test_ttk_guionly is skipped with "test_ttk_guionly skipped -- tk not available: Can't find a usable init.tcl in the following directories:. This in spite of the fact that the idle test just found init.tcl and that the ttk test passes without the idle test running first. This is relatively recent. Does the test runner not delete modules as they are finished? I am rebuilding python and will try tests again. If problem persists and patch solves it, I will go ahead and apply. |
Patch fixes problem on 3.3. I need to test 2.7 and add a note to idle_test/README that class widget attributes must be deleted because module may not be deleted, at least for a while. |
New changeset 43c4073cb2e2 by Terry Jan Reedy in branch '2.7': New changeset daf44eb9c54e by Terry Jan Reedy in branch '3.3': |
There is also a different test problem that might be related to the altered environment. See bpo-20800 |
Probably still need to add note to idle_test/README.txt. |
I recently saw the same message when developing an individual idle_test module on repository debug builds even though all class attributes were being deleted. One was an Idle EditorWindow. I solved the problem by deleting the class attributes other than root before root.destroy. I should recheck all modules/classes with attributes other than root. |
Ubuntu 12.04 64-bit Hi, just adding a few info, hope not completely useless, that seem related to the issue. I got the same message when running nosetests against my source. It's an application using Tkinter as frontend. All tests pass, though. Besides, I always destroy root in tearDown(). I noticed that the the issue only comes up when i run tests without specifying any path, like in nosetests -vs. If i enter nosetests -vs tests/unit/ tests/integration/ everything runs smooth. |
These messages are produced because there are non-handled events of destroyed root widget. They are handled when update() is called for other root widget. To get rid of them you should call update_idletasks() before destroying root widget. |
You left this issue number off your tkinter test updates, such as f6f098bdb843. By using .update_idletasks instead of .update, are you assuming that their are no user events, or that they should be ignormed? I was wondering whether it would be Ok, if not a good idea, to run tests, and maybe Idle itself, with NoDefaultRoot. I see that is already done for tkinter tests. I cannot use exactly the same design as AbstractTkTest since I sometimes do other things in setUp/tearDownClass, but I could define create_test_root() and delete_test_root() functions in a support file. |
This is minor change. Actually, it should be done yet in bpo-22236, I had
There are not only "user" events. When you create or configure some widgets,
I support it. There are some places in IDLE or tests which should be fixed,
See Lib/tkinter/test/test_tkinter/test_images.py. Image tests do other things |
New changeset 8090931ba850 by Terry Jan Reedy in branch '2.7': |
This and the followup for 3.x full the TODOs in msg219528, revise README.txt, and in msg221467, change delete order to match new advice. This issue was about conflict between test_idle and test_ttk-guionly and that has apparently been solved. After the 3.x commit, I will close this and follow up on the 'update before destroy' and 'prohibit default root' ideas on bpo-27196. |
New changeset 813bb6a4c693 by Terry Jan Reedy in branch '3.5': New changeset d8e5e3da4d57 by Terry Jan Reedy in branch 'default': |
-To avoid interfering with other GUI tests, all GUI objects must be Why "gui" is in lower case? |
Because I copied from 2.7, which had not been corrected from what I wrote years ago before we started being more consistent and correct. Fixed in all 3 versions. |
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:
The text was updated successfully, but these errors were encountered: