-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
[2.7] test_ttk_guionly doesn't destroy all widgets on Python 2.7 #75318
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
Comments
While working on bpo-31068, I wrote attached widget_instance.patch to check if test_ttk_guionly really removes all widgets. Bad news: it doesn't. Example: haypo@selma$ ./python -m test -u all test_ttk_guionly Attached fix_destroy.patch is my attempt to fix this issue. |
I only tested Python 2.7. I didn't check if other branches are affected. |
See bpo-25130. Maybe forcing garbage collecting will help. |
My widget_instance.patch calls test_support.gc_collect() and removes all |
On master, LabeledScaleTest.test_initialization() leaks a widget in the root widget, even after root.destroy(). The problem is that LabeledScaleTest.__del__() doesn't call Frame.destroy(self) if self._variable is not set. So master has at least this bug. |
widget_instance-master.patch: Check that Tkinter.Widget.destroy() removes all children and check that test_ttk_guionly doesn't leak widgets. |
Example of failure on master using widget_instance-master.patch: haypo@selma$ ./python -m test -v -u all test_ttk_guionly ====================================================================== Traceback (most recent call last):
File "/home/haypo/prog/python/master/Lib/tkinter/test/test_ttk/test_extensions.py", line 14, in tearDown
super().tearDown()
File "/home/haypo/prog/python/master/Lib/tkinter/test/support.py", line 40, in tearDown
w.destroy()
File "/home/haypo/prog/python/master/Lib/tkinter/__init__.py", line 2305, in destroy
% self.children)
Exception: destroy() doesn't clear all children: {'!labeledscale2': <tkinter.ttk.LabeledScale object .!frame.!labeledscale2>} My #3025 PR fixes LabeledScale and OptionMenu destroy() method in the master branch. |
widget_instance-2.7-v2.patch: Updated patch for Python 2.7 to debug test_ttk_guionly. #3026 fix LabeledScale and OptionMenu destroy() method for Python 2.7. |
Copy of interesting comments: #3025 serhiy-storchaka: "Parent's destroy() now is called even if this destroy() already was called. I.e. it can be called twice." haypo: "Yes, it's a deliberate choice. All other ttk widgets now have the same behaviour." -- Ok, the bug is now fixed in 2.7, 3.6 and 3.7 (master) branches. I close the issue. |
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: