tk.createfilehandler() broken with threaded tcl?

klappnase at klappnase at
Wed Sep 14 13:00:13 CEST 2005

Hello everyone,

I am running into troubles with some of my scripts that make use of
tk.createfilehandler() to catch the output messages of subprocesses I
started with popen2.Popen4() (debian linux, python-2.3.5, tk-8.4.9).
Sometimes when those background processes are running it happens that
the gui freezes and the processlist shows the subprocess in zombie
I've been using the same scripts without problems on mandrake (with
several versions of python and tk), so I came to think the problem may
be the debian build of python / tk. Now I found that on debian (unlike
mandrake) tcl/tk is build with --enable-threads, so I thought this
*might* be the cause for the problems.
I tried and replaced the call to tk.createfilehandler() with a "manual"
loop that reads Popen4.fromchild() to catch the output messages and the
problems seem to be gone, so it looks like using tk.createfilehandler()
with threaded tk is the problem.
Does anyone have an idea if this makes sense or am I on the wrong

Best regards


More information about the Python-list mailing list