[Python-bugs-list] [ python-Bugs-472727 ] Tkinter.mainloop() confuses IDLE (original) (raw)
noreply@sourceforge.net noreply@sourceforge.net
Fri, 19 Oct 2001 06:42:31 -0700
- Previous message: [Python-bugs-list] [ python-Bugs-472675 ] CVS socketmodule now doesn't compile
- Next message: [Python-bugs-list] [ python-Bugs-416696 ] --with-threads fail for 2.1c2 on HPUX 11
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Bugs item #472727, was opened at 2001-10-19 04:18 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=472727&group_id=5470
Category: IDLE Group: None
Status: Closed Resolution: Later Priority: 5 Submitted By: Edward Loper (edloper) Assigned to: Guido van Rossum (gvanrossum) Summary: Tkinter.mainloop() confuses IDLE
Initial Comment: Cause:
- create a Tk window
- call Tkinter.mainloop()
- close the Tk window created in (1)
Result:
- IDLE doesn't return to a Python prompt.
- IDLE won't close, unless you kill it from the task manager.
Code sample:
import Tkinter Tkinter.tk() Tkinter.mainloop()
Presumably, this happens because IDLE is using Tk
itself, and is not isolating the Python interactive
shell from itself well enough. It's possible that
solving this problem would require changes to kinter?
But at the very least, it should be ocumented. A
workaround (posted by stefan kusch) is to use the
following test to see if you're running in IDLE with:
_inidle = type(sys.stdin) == types.InstanceType and
sys.stdin.class.name == 'PyShell'
and not call mainloop() if you're in IDLE.
But, of course, a real fix is preferable to a workaround :)
A web search turned up several mentions of this, but I didn't see a bug report for it, so I figured I'd submit one.
Comment By: Guido van Rossum (gvanrossum) Date: 2001-10-19 06:42
Message: Logged In: YES user_id=6380
There's nothing you can do about this without a serious restructuring of IDLE, to run the Python code in a separate process. We're thinking about that, and for scripts (as opposed to the >>> shell window) it's alread implemented in the "idlefork" project on SF, where most of the development on IDLE is going on.
I'm going to close this bug report with a "Later" annotation.
You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=472727&group_id=5470
- Previous message: [Python-bugs-list] [ python-Bugs-472675 ] CVS socketmodule now doesn't compile
- Next message: [Python-bugs-list] [ python-Bugs-416696 ] --with-threads fail for 2.1c2 on HPUX 11
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]