[Python-bugs-list] [ python-Bugs-472727 ] Tkinter.mainloop() confuses IDLE (original) (raw)
noreply@sourceforge.net noreply@sourceforge.net
Fri, 19 Oct 2001 04:19:06 -0700
- Previous message: [Python-bugs-list] [ python-Bugs-472675 ] CVS socketmodule now doesn't compile
- Next message: [Python-bugs-list] [ python-Bugs-211710 ] socket.send() can do partial writes on some systems.
- 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: Open Resolution: None 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.
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-211710 ] socket.send() can do partial writes on some systems.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]