
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2015-09-14 17:48 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| 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)*![]() | 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 andAttributeError: '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)*![]() | Date: 2015-09-18 07:23 | |
Fixed patch and added tests. | |||
| msg251722 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2015-09-27 20:11 | |
Ping. | |||
| msg251760 -(view) | Author: Berker Peksag (berker.peksag)*![]() | 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)*![]() | 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)*![]() | Date: 2015-09-29 09:51 | |
LGTM too. | |||
| msg251880 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2015-09-29 19:36 | |
New changeset2ecb7d4d9e0b by Serhiy Storchaka in branch '3.5':Issue#25111: Fixed comparison of traceback.FrameSummary.https://hg.python.org/cpython/rev/2ecb7d4d9e0bNew changesetf043182a81d7 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 | |