msg242680 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2015-05-06 15:26 |
Perhaps explicitly calling NoDefaultRoot() in IDLE will help to catch some possible bugs (in IDLE or in Tkinter). It should be called only when IDLE is ran in subprocess mode, so it will not affect user code that uses Tkinter. _default_root is used mainly for interactive experiments with Tkinter. It is worth also to call NoDefaultRoot() in IDLE tests (see Tkinter tests as a guide). |
|
|
msg268873 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-06-19 21:45 |
What your thoughts about this Terry? |
|
|
msg268888 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2016-06-20 09:04 |
Time to do it, at least for tests. I think patch is ready to push, with running without default root disabled until I do more testing. In particular, reread in Rietveld, do suggested actions when run through htest, and try all menu items. |
|
|
msg268901 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-06-20 14:29 |
I ran IDLE and tests and found yet few needed changes. NoDefaultRoot() should be called only if run IDLE with a subprocess support. |
|
|
msg268902 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-06-20 14:31 |
And I thing changes to tests can be applied to all versions (especially since they become diverge), but NoDefaultRoot() should be called in IDLE only in 3.6. |
|
|
msg268979 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2016-06-21 09:38 |
I made htest run without default root, just list test_idel, and found a few more. I grepped for 'Toplevel()'. Also for bad Tk() calls. I still need to move the call in pyshell and check this over. But I think it close. |
|
|
msg269028 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2016-06-21 21:22 |
Conditioned NoDefaultRoot() on use_subprocess. Ran through menu. Will push soon after rechecking patches with Rietveld. Thanks for the additional review. I don't know that this caught any real bugs in IDLE itself. But many of the htests needed upgrading to consistently use a Toplevel with the exiting root as parent (and never start a second mainloop). Not worth backporting en masse though. |
|
|
msg269033 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-06-21 22:42 |
New changeset 064b29dde096 by Terry Jan Reedy in branch 'default': Issue #24137: Run IDLE, test_idle, and htest with tkinter default root disabled. https://hg.python.org/cpython/rev/064b29dde096 |
|
|
msg269254 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-06-25 20:53 |
New changeset a8d611eb6173 by Serhiy Storchaka in branch 'default': Issue #24137: Fixed IDLE on Linux with tkinter default root disabled. https://hg.python.org/cpython/rev/a8d611eb6173 |
|
|
msg269255 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-06-25 20:54 |
You have missed my changes in nodefaultroot2.diff. |
|
|
msg269265 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2016-06-25 23:18 |
Using Rietveld to make a 1-2 diff for each file, it appears you made 3 changes. I incorporated 2, and missed 1 (which you just pushed). I believe I incorporated your changes by hand because I had already made additional changes myself. I suspect that at that time I failed to middle-click the '1' for 'pyshell' hard enough to get the 1-2 diff for pyshell. I should have counted and checked to make sure I had all 8 diffs. |
|
|
msg271207 - (view) |
Author: Martin Panter (martin.panter) *  |
Date: 2016-07-25 02:07 |
It seems this change causes test_tix to fail for me; see Issue 27611 |
|
|
msg271224 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-07-25 04:32 |
New changeset 5c76f787e695 by Terry Jan Reedy in branch 'default': Issue #24137, issue #27611: Restore tkinter after test_idle. https://hg.python.org/cpython/rev/5c76f787e695 |
|
|
msg272821 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-08-16 04:10 |
New changeset a6a248479b66 by Terry Jan Reedy in branch 'default': Issue #27611, #24137: Only change tkinter when easily restored. https://hg.python.org/cpython/rev/a6a248479b66 |
|
|
msg320530 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2018-06-27 02:17 |
The net effect of this issue: pyshell.main calls NoDefaultRoot() when running normally, when using a subprocess and testing is not set. It does not call it when in -n mode since that would affect users. idle_test.htest calls NoDefaultRoot() unconditionally. pyshell.main is not called. test.test_idle sets testing to avoid the call when run by test.regrtest, to avoid failing the latter's changed-environment check. But it does call NoDefaultRoot when run as __main__ and the tests are run by unittest.main. Known dependencies on a default root have been removed. It is unlikely that any are left. |
|
|