[Tkinter-discuss] How to capture exceptions after the end of the program

Cameron Laird Cameron at phaseit.net
Fri Jun 25 19:15:02 CEST 2010


On Fri, Jun 25, 2010 at 01:54:57PM +0200, Vasilis Vlachoudis wrote:
			.
			.
			.
> unfortunately I cannot do that since I am using the output for other 
> messages
> 
> Vasilis
> 
> On 06/25/10 13:14, Wayne Werner wrote:
> >On Fri, Jun 25, 2010 at 5:20 AM, Vasilis Vlachoudis 
> ><Vasilis.Vlachoudis at cern.ch <mailto:Vasilis.Vlachoudis at cern.ch>> wrote:
> >
> >    Hi all,
> >
> >    I have a tkinter application that uses several fonts. However only
> >    with python 2.4 when the application is closed then I get the
> >    following exceptions (with 2.6 it works Ok)
> >
> >    Exception exceptions.AttributeError: "'NoneType' object has no
> >    attribute 'TclError'" in <bound method Font.__del__ of
> >    <tkFont.Font instance at 0x2ac0dd4c4908>> ignored
> >    Exception exceptions.AttributeError: "'NoneType' object has no
> >    attribute 'TclError'" in <bound method Font.__del__ of
> >    <tkFont.Font instance at 0x2ac0dd4c4680>> ignored
> >
> >    and I have no way of capturing them since they arrive even after
> >    the last line of the program.
> >    I believe that for some reason the tkinter is deleted before and
> >    afterwards it tries to delete the fonts and creates the TclError.
> >    Is there a way to protect for these exceptions?
> >
> >
> >If you're on linux you can redirect the errors via
> >
> >$ python myfile.py > mylog.txt
> >
> >I'm not sure how you would catch the exceptions, though.
			.
			.
			.
While I've become quite confused about what "that" is, Vasilis,
please be aware that the same data can go to more than one sink.
<URL: http://unixhelp.ed.ac.uk/CGI/man-cgi?tee >, for example,
might interest you--if you're not already aware of it.


More information about the Tkinter-discuss mailing list