python.exe/Tkinter hang on exit

Mike Clarkson support at internetdiscovery.com
Thu Sep 6 19:11:45 EDT 2001


On Wed, 05 Sep 2001 05:57:04 GMT, Howard Lightstone
<howard at eegsoftware.com> wrote:

>About 1 out of 3 times I run my python.exe apps that use Tkinter windows
>(Windows98SE), the application becomes a zombie if I close the app using
>the x-box to kill the Tkinter window.  If I remember to do it (which
>seems to be tough lately), a Ctrl-C in the dos box seems to ALWAYS kill
>the app.

What version of Tk are you using?

>It seems the application is hanging on OLESCELOCKMUTEX during
>termination, thus leaving a zombie task (which...typically... means I
>cannot shut Windows down gracefully, if such a thing were possible).

What diagnostics are you using to detemine that it's a mutex hang?
Can you tell which thread is hung - a running python.exe has 2 threads
and loading Tkinter adds I think 3 more threads. The one that is
steadily consuming CPU is probably the Tk mainloop. Can you tell if
it's that one, one of the other threads started with Tk, or an
original Python thread that gets locked?

>I am assuming that some win32 thingey is not being called by the Tkinter
>task temination logic,  BUT,  using pythonw.exe, termination ALWAYS
>works correctly.  (I am using Python 2.0)

Can you post the Python code that your application uses to exit,
including any wm_protocol calls you make to bind the x.

>Any clues?  I haven't tried to take apart my apps and see which imports
>do it
>(but Pmw looks like just a wrapper) .

It's a tough one, and it would be good to nail this one down.

Mike. 



More information about the Python-list mailing list