Pmw Error: "TclError: can't unset "unknown_pending(": no such variable"

Chad Netzer cnetzer at mail.arc.nasa.gov
Sat Feb 15 01:24:41 CET 2003


On Fri, 2003-02-14 at 15:54, Marc wrote:

> I'm getting an error that I can't find an explanation for. It's very
> intermittent and works 99% of the time. Then that 1% comes along and
> causes my app to crash.

Before reading any further, I suspect you might be using threads.

>  It causes a window's exception, and an error
> log is generated. This is unusual because usually Python errors are
> caught before it ever hits windows. Here's the error:
> 
> ----------------------------------------------------------
> Exception in thread Thread-1:
> Traceback (most recent call last):
>   File "threading.pyc", line 408, in __bootstrap

Aha!

> It could be a threading issue.

Bingo.  You must do all your calls to Tkinter (and hence Tcl) in a
single thread.  Thus, only one thread should know about widgets.
Absolutely only one thread can be in mainloop() (!!).

What are the threads doing?  Unless you say otherwise, I'm going to
assume this is an issue with multiple threads interacting with the GUI
objects.  There are discussions on the Web and the group about how to
deal with this, so some googling may be of help.  Also, the Queue object
is often recommended for having a master UI thread communicate with
workers (but I've never used it)

> Thanks ahead of time,
> Marc

-- 
Bay Area Python Interest Group - http://www.baypiggies.net/

Chad Netzer
(any opinion expressed is my own and not NASA's or my employer's)







More information about the Python-list mailing list