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.
Created on 2015年09月14日 17:48 by serhiy.storchaka, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| traceback_FrameSummary_equality.patch | serhiy.storchaka, 2015年09月14日 17:49 | review | ||
| traceback_FrameSummary_equality_2.patch | serhiy.storchaka, 2015年09月18日 07:23 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg250693 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年09月14日 17:48 | |
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).
|
|||
| msg250953 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年09月18日 07:23 | |
Fixed patch and added tests. |
|||
| msg251722 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2015年09月27日 20:11 | |
Ping. |
|||
| msg251760 - (view) | Author: Berker Peksag (berker.peksag) * (Python committer) | Date: 2015年09月28日 11:19 | |
LGTM + self.assertEqual(f, tuple(f)) + self.assertEqual(tuple(f), f) It would be good to add a comment to explain why we test both variants, but it's not really important. |
|||
| msg251834 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2015年09月29日 09:49 | |
traceback_FrameSummary_equality_2.patch looks good to me, but I have the same remark than Berker (see the review). |
|||
| msg251835 - (view) | Author: Robert Collins (rbcollins) * (Python committer) | Date: 2015年09月29日 09:51 | |
LGTM too. |
|||
| msg251880 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2015年09月29日 19:36 | |
New changeset 2ecb7d4d9e0b by Serhiy Storchaka in branch '3.5': Issue #25111: Fixed comparison of traceback.FrameSummary. https://hg.python.org/cpython/rev/2ecb7d4d9e0b New changeset f043182a81d7 by Serhiy Storchaka in branch 'default': Issue #25111: Fixed comparison of traceback.FrameSummary. https://hg.python.org/cpython/rev/f043182a81d7 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:21 | admin | set | github: 69298 |
| 2015年09月29日 19:37:09 | serhiy.storchaka | set | status: open -> closed assignee: serhiy.storchaka resolution: fixed stage: commit review -> resolved |
| 2015年09月29日 19:36:33 | python-dev | set | nosy:
+ python-dev messages: + msg251880 |
| 2015年09月29日 09:51:29 | rbcollins | set | messages: + msg251835 |
| 2015年09月29日 09:49:21 | vstinner | set | nosy:
+ vstinner messages: + msg251834 |
| 2015年09月28日 11:19:13 | berker.peksag | set | nosy:
+ berker.peksag messages: + msg251760 stage: patch review -> commit review |
| 2015年09月27日 20:11:09 | serhiy.storchaka | set | messages: + msg251722 |
| 2015年09月18日 07:23:20 | serhiy.storchaka | set | files:
+ traceback_FrameSummary_equality_2.patch messages: + msg250953 |
| 2015年09月14日 17:49:00 | serhiy.storchaka | set | files:
+ traceback_FrameSummary_equality.patch keywords: + patch |
| 2015年09月14日 17:48:43 | serhiy.storchaka | create | |