This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Tkinter hangs in test_tcl
Type: Stage:
Components: Tkinter Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: loewis Nosy List: loewis, twouters
Priority: normal Keywords:

Created on 2006-04-23 21:34 by twouters, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg28335 - (view) Author: Thomas Wouters (twouters) * (Python committer) Date: 2006-04-23 21:34
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.
msg28336 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-05-01 06:30
Logged In: YES 
user_id=21627

This should now be fixed with r45833 and r45834.
History
Date User Action Args
2022-04-11 14:56:17adminsetgithub: 43267
2006-04-23 21:34:43twouterscreate