[Zope3-dev] RFC: __traceback_supplement__ versus __traceback_info__

Shane Hathaway shane at hathawaymix.org
Fri Jan 27 18:31:03 EST 2006


Christian Theune wrote:
> Hi,
> 
> somehow there is a mixup between using __traceback_supplement__ and
> __traceback_info__.
> 
> In Zope 2, I'm used to use __traceback_info__. In Zope 3 it seems like
> the exception formatters use __traceback_supplement__. However, quite
> some code in Zope 3.2 uses __traceback_info__ still, and only a few
> places (security checkers) use __traceback_supplement__.

Actually, Zope 2 has both forms as well.  We use it primarily to tell 
ZPT authors which page template broke and where.

__traceback_info__ is for arbitrary information. 
repr(__traceback_info__) gets dumped to the traceback.

__traceback_supplement__ is more structured.  It should be a tuple.  The 
first item of the tuple is a callable that produces an object that 
implements ITracebackSupplement, and the rest of the tuple contains 
arguments to pass to the factory.  The traceback formatter makes an 
effort to clearly present the information provided by the 
ITracebackSupplement.

I just added this explanation to zope.exceptions.interfaces.  Other than 
the excessive length of the name __traceback_supplement__, I like the 
way the system works.

Shane


More information about the Zope3-dev mailing list