[Zope3-dev] Excessive long traceback info in TALES

Guido van Rossum guido@python.org
Tue, 10 Dec 2002 13:18:24 -0500


> Guido van Rossum wrote:
> > BTW, Python 2.2 and later have a module "cgitb" which formats a
> > traceback in a nice way.  Using it is as simple as calling
> > cgitb.html(sys.info()).
> 
> That's good to know.

BTW I meany sys.exc_info().

> > Maybe this could be used to replace the current sub-optimal traceback
> > (with no source code) that gets displayed?
> 
> The traceback includes the filename and position of errors in page 
> templates, which is very valuable.  I'm surprised you consider this 
> sub-optimal.

Sorry, I hadn't thought of this issue yet.  I'm more used to debugging
Python code than page templates.  You're right of course.

> I'm not sure what you mean by "no source code".  If you mean that it 
> shows the module name rather than the filename, I'd hate to go back on 
> that change.  It made Zope 2.6 tracebacks far more readable!

What I'm missing most from "regular" tracebacks is the text of the
source line.  I know I can look that up, but often just seeing the
code in the traceback is enough to tell me what's wrong...

--Guido van Rossum (home page: http://www.python.org/~guido/)