Author serhiy.storchaka
Recipients rbcollins, serhiy.storchaka
Date 2015-09-14.17:48:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442252923.78.0.0672158797601.issue25111@psf.upfronthosting.co.za>
In-reply-to
Content
Since 3.5 traceback.extract_tb() and traceback.extract_stack() return a list (actually list's subclass StackSummary) of FrameSummary objects instead of a list of tuples. FrameSummary is not fully compatible with tuple. One important incompatibility is in the comparing.

>>> import traceback
>>> traceback.extract_stack()[0] == ('<stdin>', 1, '<module>', '')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython-3.5/Lib/traceback.py", line 254, in __eq__
    return (self.filename == other.filename and
AttributeError: 'tuple' object has no attribute 'filename'

In general __eq__ shouldn't raise an exception. Issue25108 is needed to be fixed first for tests.

Here is a patch that restores compatibility.

An alternative solution would be to make FrameSummary a subclass of tuple (namedtuple).
History
Date User Action Args
2015-09-14 17:48:43serhiy.storchakasetrecipients: + serhiy.storchaka, rbcollins
2015-09-14 17:48:43serhiy.storchakasetmessageid: <1442252923.78.0.0672158797601.issue25111@psf.upfronthosting.co.za>
2015-09-14 17:48:43serhiy.storchakalinkissue25111 messages
2015-09-14 17:48:43serhiy.storchakacreate