[Python-bugs-list] [ python-Bugs-626936 ] canvas.create_box() crashes Tk thread
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 23 Oct 2002 06:40:26 -0700
Bugs item #626936, was opened at 2002-10-22 17: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: Martin v. Löwis (loewis)
Date: 2002-10-23 15:40
Message:
Logged In: YES
user_id=21627
As I said, this is difficult to understand, since _tkinter has no
return Py_None in the relevant code: it might be memory
corruption in an completely unrelated module.
Are you using any funny extension modules?
Can you post a self-contained example that might allow me
to reproduce the problem?
Could you try to debug the associated C code in a debugger?
I.e. set a breakpoint onto the single return in Tkapp_Call (the
USING_OBJECTS version), and conditionalize it on
res==Py_None. Then inspect the state of the Tcl interp.
Sorry I can't be of more help.
----------------------------------------------------------------------
Comment By: T. Koehler (rasfahan)
Date: 2002-10-23 13: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 19: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