TclError: bad option "<whatever>": must be cget or configure

Kevin@Cazabon.com kevin at cazabon.com
Wed Nov 13 19:18:22 EST 2002


Thanks Russell... I'll definately try the dictionary method you mention, I
didn't know that would work (I've always used configure as per "the
manual"...).

If that fails, I'll see if I can put some tracing into Tkinter or something
to see just exactly what it's TRYING to call.  As much as I'm convinced it's
a Tkinter bug (or possibly a Tcl bug), I'm always happy to be wrong if it
solves my problem!  q:]

Much appreciated, I'll keep you posted

Kevin.


"Russell E. Owen" <owen at nospam.invalid> wrote in message
news:aqrlor$23v8$1 at nntp6.u.washington.edu...
> This sounds nasty.
>
> I ran Wish to see if I could figure out what makes your error, and it's
> acting as if both "config" and the name of the option to be configured
> are missing:
> frame .g
> .g config -bg "red";  # correct
> .g config "red"; # wrong
> unkonwn option "red"
> .g "red";  # wrong
> bad option "red": must be cget or configure
>
> I was not able to find an equivalent Tkinter command to produce this
> error message, but I don't claim to have tried everything. For instance:
> f = Frame()
> f.yellow()
> AttributeError: Frame instance has no attribute 'yellow'
> f["yellow"]
> TclError: unknown option "-yellow"
>
> Can you test the hypothesis that it's thread-related? Can you produce a
> short program that exhibits the problem that others can try?
>
> Also, as sort of voodoo, you might try replacing your use of configure
> with the dictionary approach, e.g. frame["bg"] = "yellow", to see if
> this helps or changes the error message to something more useful.
>
> -- Russell
>
> In article <lp%y9.15549$O71.6983 at rwcrnsc53>,
>  "Kevin at Cazabon.com" <kevin at cazabon.com> wrote:
>
> >I'm having some weird Tcl errors, and can't seem to track them down, any
> >help?
> >
> >1)  these are happening in multiple locations, when I use the "configure"
> >method for widgets
> >
> >2)  the calls work 99.9% of the time, but when the system is under heavy
> >load they fail with "TclError: bad option "yellow": must be cget or
> >configure" errors
> >
> >3)  I'm using a valid "configure" command (such as
> >self.label.configure(text="yellow")), and it seems to think I called
> >"self.frame.yellow()" or self.frame.configure(yellow = xxx).
> >
> >
> >My application is multi-threaded (3 threads total, all using
locks/mutexes
> >on shared objects, only one thread is doing Tcl stuff), and I'm using
> >ActivePython 2.2.1 build 222.





More information about the Python-list mailing list