[ python-Bugs-1475162 ] Tkinter hangs in test_tcl

SourceForge.net noreply at sourceforge.net
Sun Apr 23 23:34:43 CEST 2006


Bugs item #1475162, was opened at 2006-04-23 23:34
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1475162&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tkinter
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Wouters (twouters)
Assigned to: Martin v. Löwis (loewis)
Summary: Tkinter hangs in test_tcl

Initial Comment:

For a while now, I've noticed test_tcl locking up when
trying to refleaktest it. I was able to reproduce it
quite simply:

import Tkinter, os
if "DISPLAY" in os.environ: del os.environ["DISPLAY"]
tcl = Tkinter.Tcl()
try: tcl.loadtk()
except Exception, e: print e
tcl.loadtk()

Or using _tkinter directly:

import _tkinter, os
if "DISPLAY" in os.environ: del os.environ["DISPLAY"]
tk = _tkinter.create(None, "test", "Tk", 0, 1, 0)
try: tk.loadtk()
except: pass
tk.loadtk()

In either case, the second loadtk never finishes.

It seems that, on my platform at least, Tk_Init()
doesn't like being called twice even when the first
call resulted in an error. That's Tcl and Tk 8.4.12.
Tkapp_Init() (which is the Tkinter part that calls
Tk_Init()) does its best to guard against calling
Tk_Init() twice when the first call was succesful, but
it doesn't remember failure cases. I don't know enough
about Tcl/Tk or Tkinter to know how this is best handled.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1475162&group_id=5470


More information about the Python-bugs-list mailing list