[ python-Bugs-626936 ] canvas.create_box() crashes Tk thread
SourceForge.net
noreply at sourceforge.net
Sat Jun 5 18:05:17 EDT 2004
Bugs item #626936, was opened at 2002-10-22 11:54
Message generated for change (Comment added) made by akuchling
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=626936&group_id=5470
Category: Tkinter
Group: Platform-specific
>Status: Closed
>Resolution: Out of Date
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: A.M. Kuchling (akuchling)
Date: 2004-06-05 18:05
Message:
Logged In: YES
user_id=11375
No discussion in 18 months; closing this bug.
----------------------------------------------------------------------
Comment By: T. Koehler (rasfahan)
Date: 2002-10-23 14:29
Message:
Logged In: YES
user_id=634021
So far, I have failed to produce the bug in a small
code-snippet. We use no library that isn't included in the
standard python downloads, and the bug is reproducible with
all 2.x versions. The create_rectangle call is located in
another thread (created with thread.start_new_thread),
though, than the
Tk.mainloop of the root window of the canvas - might that be
a problem?
Unfortunatly, I do not have access to a debugger/c-compiler
for windows, except for cygwin, where the problem does not
exist.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-10-23 09: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 07: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 13: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
More information about the Python-bugs-list
mailing list