[issue27910] Doc/library/traceback.rst — references to tuples should be replaced with new FrameSummary object
New submission from Tomas Orsava: In the documentation for the `traceback` module, the definitions of functions `extract_tb` [0], `format_list` [1] and classmethod `from_list` [2] mention the old style (4-)tuples that these functions used to return or accept. Since Python 3.5, however, they return or accept a FrameSummary object instead of the 4-tuple, or a StackSummary object instead of a list of 4-tuples. I'm including a patch that fixes these definitions to make them reflect the new reality. [0] https://docs.python.org/3.6/library/traceback.html#traceback.extract_tb [1] https://docs.python.org/3.6/library/traceback.html#traceback.format_list [2] https://docs.python.org/3.6/library/traceback.html#traceback.StackSummary.fr... ---------- assignee: docs@python components: Documentation files: traceback-doc.patch keywords: patch messages: 274010 nosy: docs@python, torsava priority: normal severity: normal status: open title: Doc/library/traceback.rst — references to tuples should be replaced with new FrameSummary object versions: Python 3.5, Python 3.6 Added file: http://bugs.python.org/file44293/traceback-doc.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27910> _______________________________________
Changes by SilentGhost <ghost.adh@runbox.com>: ---------- stage: -> patch review type: -> behavior _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27910> _______________________________________
SilentGhost added the comment: LGTM. ---------- nosy: +SilentGhost stage: patch review -> commit review _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27910> _______________________________________
Berker Peksag added the comment: I think we need to decide whether this is a documentation bug or a regression in traceback module. See also issue 25573 for a similar report. ---------- nosy: +berker.peksag, r.david.murray, rbcollins stage: commit review -> patch review _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27910> _______________________________________
Tomas Orsava added the comment: Hi Berker: It's a bit complicated—this specific issue I opened isn't a regression, because it's exactly the change that was intended: Use FrameSummary instead of a 4-tuple to pass the frame data. If you see the last comment for the issue 25573 you linked to, that issue has already been resolved by the docs being updated to reflect the new way of passing data. However, that is not to say there can't be regressions connected to this, but they have to do with the fact that FrameSummary implements only a subset of methods available of tuples. E.g. that FrameSummary does not implement __len__ like tuple does, see issue 26502. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27910> _______________________________________
Petr Viktorin added the comment: This was a deliberate change in 3.5. Issue: https://bugs.python.org/issue17911 News entry: https://docs.python.org/3/whatsnew/3.5.html#traceback Why do you think it is a regression? Who would be the person that can decide if it is a doc bug or regression? ---------- nosy: +encukou _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27910> _______________________________________
Petr Viktorin added the comment: ping Anything I can do to move this forward? ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27910> _______________________________________
Emanuel Barry added the comment: This is not a regression, the documentation was just not fully updated when the new feature was added. Patch looks good. This should probably be applied to the 3.5 branch as well. ---------- nosy: +ebarry stage: patch review -> commit review versions: +Python 3.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue27910> _______________________________________
Cheryl Sabella <chekat2@gmail.com> added the comment: Tomas, Would you be willing to make a Github pull request with your patch? Thanks. ---------- nosy: +csabella stage: commit review -> needs patch versions: +Python 3.8 -Python 3.5, Python 3.6 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27910> _______________________________________
Change by Tomas Orsava <tomas.n@orsava.cz>: ---------- pull_requests: +5879 stage: needs patch -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27910> _______________________________________
Tomas Orsava <tomas.n@orsava.cz> added the comment: Hey Cheryl, here is the pull request: https://github.com/python/cpython/pull/6116 ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27910> _______________________________________
Berker Peksag <berker.peksag@gmail.com> added the comment: New changeset f394ee5eaf6d6d8f45e0478e77d4dbff25c6bea7 by Berker Peksag (torsava) in branch 'master': bpo-27910: Update documentation of traceback module (GH-6116) https://github.com/python/cpython/commit/f394ee5eaf6d6d8f45e0478e77d4dbff25c... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27910> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +8134 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27910> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +8135 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27910> _______________________________________
Berker Peksag <berker.peksag@gmail.com> added the comment: New changeset 0f9df886d6d1c6b239a2861a0ad0d56bb59e3922 by Berker Peksag (Miss Islington (bot)) in branch '3.7': bpo-27910: Update documentation of traceback module (GH-6116) https://github.com/python/cpython/commit/0f9df886d6d1c6b239a2861a0ad0d56bb59... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27910> _______________________________________
Berker Peksag <berker.peksag@gmail.com> added the comment: New changeset 295342adbfd905d5b4a77f960ea39649df7d9997 by Berker Peksag (Miss Islington (bot)) in branch '3.6': bpo-27910: Update documentation of traceback module (GH-6116) https://github.com/python/cpython/commit/295342adbfd905d5b4a77f960ea39649df7... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27910> _______________________________________
Change by Berker Peksag <berker.peksag@gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.6 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue27910> _______________________________________
participants (7)
-
Berker Peksag
-
Cheryl Sabella
-
Emanuel Barry
-
miss-islington
-
Petr Viktorin
-
SilentGhost
-
Tomas Orsava