[Tkinter-discuss] Strange Tkinter bug...

Vasilis Vlachoudis Vasilis.Vlachoudis at cern.ch
Fri Oct 27 12:19:20 CEST 2006


Dear All,

I am writting an application using Tkinter and I have the following 
(annoying problem). I have a class to display randomly tips when the 
program starts. It shows a dialog with a lamp image on the left and a 
text message on the right with the tip, and I am selecting randomly a 
tip from the database. If I use the "import random" in the class to 
select with
tip = random.randint(0,len(TipDialog.tips)-1)
the random tip, at the exit of the program I get the following messages 
for all PhotoImages I have loaded:

Exception _tkinter.TclError: <_tkinter.TclError instance at 
0x2aaaae09b758> in <bound method PhotoImage.__del__ of 
<Tkinter.PhotoImage instance at 0x2aaaae1ae320>> ignored
Exception _tkinter.TclError: <_tkinter.TclError instance at 
0x2aaaae09b758> in <bound method PhotoImage.__del__ of 
<Tkinter.PhotoImage instance at 0x2aaaae1ae368>> ignored
Exception _tkinter.TclError: <_tkinter.TclError instance at 
0x2aaaae20a6c8> in <bound method PhotoImage.__del__ of 
<Tkinter.PhotoImage instance at 0x2aaaaed34f38>> ignored
Exception _tkinter.TclError: <_tkinter.TclError instance at 
0x2aaaae20a6c8> in <bound method PhotoImage.__del__ of 
<Tkinter.PhotoImage instance at 0x2aaaaed34f80>> ignored
...

If I comment out the "#import random" then I am using the 
10ths-milliseconds of the time to get a random tip
tip = int(time.time()*100)%len(TipDialog.tips)
then at the exit I get NO error message at all.
There should be some memory leak either on the random or on the PhotoImage?

Regards
Vasilis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Vasilis.Vlachoudis.vcf
Type: text/x-vcard
Size: 312 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tkinter-discuss/attachments/20061027/03a61032/attachment.vcf 


More information about the Tkinter-discuss mailing list