tkinter: Better Traceback

Fredrik Lundh fredrik at pythonware.com
Wed Jul 16 10:53:00 EDT 2003


Thomas Güttler wrote:

> Is there a way to get a better traceback in tkinter?
> It would be nice to see the line number of the last line
> of "my" code.
>
> Exception in Tkinter callback
> Traceback (most recent call last):
>   File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/lib-tk/Tkinter.py",
> line 1299, in __call__
>     args = apply(self.subst, args)
>   File "/var/tmp/python-2.2.2-build//usr/lib/python2.2/lib-tk/Tkinter.py",
> line 1035, in _substitute
>     e.height = getint(h)
> ValueError: invalid literal for int(): ??

it's not a bug in your code, it's an incompatible change in Tk 8.4.2, which
uses "??" to represent an "undefined integer".

either upgrade your Tkinter (Python 2.3 contains a workaround), or down-
grade your Tk to 8.4.1 or earlier (or link Tkinter against Tk 8.3.x).

</F>








More information about the Python-list mailing list