[Tkinter-discuss] Tkinter under SMP

Douglas S. Blank dblank at cs.brynmawr.edu
Mon May 24 12:14:52 EDT 2004


Doug Blank wrote:
> Hello tkinter-discuss,
> 
> I'm new to this list, but have a question: I seem to have a lot of problems running tkinter under a particular Linux (RedHat 9), PC computer, which happens to have two processors. Could this be the problem?
> 
> The problem specifically is that I get very strange Tk errors, like:
> 
> attempt to apply int(): None
> 
> but every time it is a different error. I never have any problems (like these) on any other (non-SMP) machine.

To which Jeff Epler wrote:
 > I've never seen this error message before.
 >

Sorry, that wasn't an exact error message. But it is a different error 
every time. Here are some examples:

----------------------------------------------------------------------
   File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 1969, in 
create_rectangle
     return self._create('rectangle', args, kw)
   File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 1947, in _create
     (self._w, 'create', itemType)
ValueError: invalid literal for int(): None
----------------------------------------------------------------------
   File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 1969, in 
create_rectangle
     return self._create('rectangle', args, kw)
   File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 1947, in _create
     (self._w, 'create', itemType)
TclError: unknown option "141138396callit"
----------------------------------------------------------------------
   File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 1969, in 
create_rectangle
     return self._create('rectangle', args, kw)
   File "/usr/lib/python2.2/lib-tk/Tkinter.py", line 1947, in _create
     (self._w, 'create', itemType)
TclError: bad screen distance "141139772callit"
----------------------------------------------------------------------

These all come from "create_rectange", but if I run it some more, other 
Tk commands will cause similar errors.

Like I said, it seems to only happen on the dual-CPU computer, and 
usually only in code that updates the screen a lot, very quickly. I 
can't really come up with a simple example easily, because it only 
happens with multiple threads, fast updates, multiple objects, etc.

Is there anyone running Tkinter on dual-CPU computers and have Tkinter 
work reliably? I really suspect that the Tkinter code may not be thread 
safe. Anyone have any ideas on fixing or minimizing these errors if that 
is true? (I realize I could boot without SMP, but I'm looking for a fix 
that is a little more specific to the problem.)

Thanks for any suggestions!

-Doug

> 
> If this is a problem, is there a known work-around, or plans to fix it?
> 
> Thanks!
> 
> -Doug 


> I took a quick look in the Python source, and I couldn't find "attempt
> to apply" in any of the .c or .py files.  The terms "apply", "int()" and
> "None" make this error unlikely to come from the tcl or tk libraries.
> 
> Can you provide more information, such as a complete traceback or tcl
> error?  Can you find a small program that produces the error and send it
> to the list?
> 
> Jeff
> 
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
> 
> 




More information about the Tkinter-discuss mailing list