[Zope] Python traceback offsets?

Skip Montanaro skip@pobox.com
Thu, 14 Nov 2002 14:15:47 -0600


I added <dtml-var error_tb> to my standard_error_message so I could get
tracebacks.  Unfortunately, the information displayed isn't always enough to
tell me where the error actually occurred (e.g.,
"AttributeError... __call__" doesn't mention any actual objects in my
script), and the line numbers are off by some amount because of the missing
function stuff and the boilerplate comments placed at the head of the
script when I edit it via ftp.

Is there some sort of fixed offset I can use to calculate the actual line
number of the error in my Python script?  Alternately, can I tweak the
<dtml-var error_tb> stuff to get a complete traceback which includes Python
source?

Thx,

-- 
Skip Montanaro - skip@pobox.com
http://www.mojam.com/
http://www.musi-cal.com/