This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author abingham
Recipients abingham
Date 2011-01-02.14:23:48
SpamBayes Score 1.655452e-08
Marked as misclassified No
Message-id <1293978231.38.0.946265028499.issue10805@psf.upfronthosting.co.za>
In-reply-to
Content
traceback.print_exception() will throw an AttributeException if `value` is None and `chain` is True. This is because `_iter_chain` assumes that the exception object has a `__cause__` attribute. You can trigger this by trying for format a non-existent exception:

  >>> import logging, sys
  >>> logging.Formatter().formatException(sys.exc_info())
  Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.1/logging/__init__.py", line 418, in formatException
    traceback.print_exception(ei[0], ei[1], ei[2], None, sio)
  File "/usr/lib/python3.1/traceback.py", line 155, in print_exception
    for value, tb in values:
  File "/usr/lib/python3.1/traceback.py", line 122, in _iter_chain
    cause = exc.__cause__

This is assuming that sys.exc_info() returns (None, None, None).
History
Date User Action Args
2011-01-02 14:23:51abinghamsetrecipients: + abingham
2011-01-02 14:23:51abinghamsetmessageid: <1293978231.38.0.946265028499.issue10805@psf.upfronthosting.co.za>
2011-01-02 14:23:48abinghamlinkissue10805 messages
2011-01-02 14:23:48abinghamcreate