[Python-bugs-list] [ python-Bugs-626936 ] canvas.create_box() crashes Tk thread

noreply@sourceforge.net noreply@sourceforge.net
Wed, 23 Oct 2002 04:09:26 -0700


Bugs item #626936, was opened at 2002-10-22 15:54
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=626936&group_id=5470

Category: Tkinter
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: T. Koehler (rasfahan)
Assigned to: Nobody/Anonymous (nobody)
Summary: canvas.create_box() crashes Tk thread

Initial Comment:
Frequently, but apparently not depending on the
paramters passed, the following exception will be
thrown, and Tk will stop responding while the
interpreter continues to run. This is on Windows (95,
98, 2000), under linux, the problem does not occur.
All parameters passed have int-values, we checked that
first.
The exception can be caught via a try-statement, but Tk
will stop responding anyway.

---snip
    self.rectangle
=self.canvas.create_rectangle(self.x,self.y+1,self.x2,self.y
2-1)
  File "D:\PYTHON21\lib\lib-tk\Tkinter.py", line 1961,
in create_rectangle
    return self._create('rectangle', args, kw)
  File "D:\PYTHON21\lib\lib-tk\Tkinter.py", line 1939,
in _create
    (self._w, 'create', itemType)
ValueError: invalid literal for int(): None
---snap


----------------------------------------------------------------------

>Comment By: T. Koehler (rasfahan)
Date: 2002-10-23 11:09

Message:
Logged In: YES 
user_id=634021

Ok, here's the output of the last two print-statements
before the exception from getint(). To me it looks as if the
tk.app.call actually did return None.
('.8476780.13726076.8520076', 'create', 'rectangle', 50, 3,
250, \
13, '-fill', '#00FF00')
None


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-10-22 17:03

Message:
Logged In: YES 
user_id=21627

Can you please investigate this a little bit further? Split
the return statement in _create into several parts

  command = (self._w, 'create', itemType) + args + \
     self._options(cnf, kw)
  print command
  result = apply(self.tk.call, command)
  print result
  return getint(result)

It seems that result will become None. This, in turn, is
quite impossible: tk.app.call will never return None.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=626936&group_id=5470