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 Drekin
Recipients Drekin
Date 2015-07-23.14:52:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1437663140.05.0.49769295759.issue24696@psf.upfronthosting.co.za>
In-reply-to
Content
There is a subtle bug in Python 3.4 implementation of traceback library:

>>> import traceback
>>>
>>> try:
...     1 / 0
... except Exception as e:
...     exc = e
...
>>> traceback.print_exception(exc.__class__, exc, exc.__traceback__)
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
ZeroDivisionError: division by zero
>>> 
>>> traceback.print_exception(exc.__class__, exc, None)
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
ZeroDivisionError: division by zero
>>> 
>>> traceback.print_exception(exc.__class__, exc, None, chain=False)
ZeroDivisionError: division by zero

As can be seen, giving None traceback is ignored if chain == True. This is because None is incorrectly used as a sentinel value in traceback._iter_chain (see line 135).

Note that this bug is fixed in Python 3.5 since there is a new implementation of traceback module using TracebackException objects. Will this be backported to Python 3.4? Otherwise, the bug itself should be fixed anyway.
History
Date User Action Args
2015-07-23 14:52:20Drekinsetrecipients: + Drekin
2015-07-23 14:52:20Drekinsetmessageid: <1437663140.05.0.49769295759.issue24696@psf.upfronthosting.co.za>
2015-07-23 14:52:20Drekinlinkissue24696 messages
2015-07-23 14:52:19Drekincreate