Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't print traceback header if traceback is None in TracebackException #68883

Closed
Drekin mannequin opened this issue Jul 23, 2015 · 13 comments
Closed

Don't print traceback header if traceback is None in TracebackException #68883

Drekin mannequin opened this issue Jul 23, 2015 · 13 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@Drekin
Copy link
Mannequin

Drekin mannequin commented Jul 23, 2015

BPO 24695
Nosy @rhettinger, @rbtcollins, @berkerpeksag, @iritkatriel
Files
  • issue24695.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-07-24.14:39:03.743>
    created_at = <Date 2015-07-23.14:42:19.577>
    labels = ['type-bug', 'library']
    title = "Don't print traceback header if traceback is None in TracebackException"
    updated_at = <Date 2020-11-27.10:14:41.256>
    user = 'https://bugs.python.org/Drekin'

    bugs.python.org fields:

    activity = <Date 2020-11-27.10:14:41.256>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-07-24.14:39:03.743>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2015-07-23.14:42:19.577>
    creator = 'Drekin'
    dependencies = []
    files = ['40001']
    hgrepos = []
    issue_num = 24695
    keywords = ['patch']
    message_count = 13.0
    messages = ['247208', '247220', '247231', '247241', '247277', '247278', '247279', '247434', '247436', '247437', '247441', '247443', '381939']
    nosy_count = 6.0
    nosy_names = ['rhettinger', 'rbcollins', 'python-dev', 'berker.peksag', 'Drekin', 'iritkatriel']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue24695'
    versions = ['Python 3.5', 'Python 3.6']

    @Drekin
    Copy link
    Mannequin Author

    Drekin mannequin commented Jul 23, 2015

    The documentation of traceback.print_exception says "if traceback is not None, it prints a header Traceback (most recent call last):". That also meant that the header wasn't printed if traceback was None. However, the new Python 3.5 TracebackException object always prints the header.

    @Drekin Drekin mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jul 23, 2015
    @bitdancer bitdancer changed the title Don't print traceback header if traceback is None Don't print traceback header if traceback is None in TracebackException Jul 23, 2015
    @rbtcollins
    Copy link
    Member

    Huh,indeed.

    So clearly we should have a test for that behaviour (and fix it).

    We're very close to the 3.5 release date, but this is a regression - care to whip up a patch?

    @berkerpeksag
    Copy link
    Member

    Here is a patch. I was pretty sure that I've already created an issue for this but couldn't find it now.

    @rhettinger
    Copy link
    Contributor

    This patch looks correct, applies cleanly, and passes tests.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 24, 2015

    New changeset b45077269aaa by Berker Peksag in branch '3.5':
    Issue bpo-24695: Fix a regression in traceback.print_exception()
    https://hg.python.org/cpython/rev/b45077269aaa

    New changeset 2825c87d3f72 by Berker Peksag in branch 'default':
    Issue bpo-24695: Fix a regression in traceback.print_exception()
    https://hg.python.org/cpython/rev/2825c87d3f72

    @berkerpeksag
    Copy link
    Member

    Fixed in 3.5 and default branches. Thank you for your review, Raymond.

    @Drekin
    Copy link
    Mannequin Author

    Drekin mannequin commented Jul 24, 2015

    Thank you all for a quick reaction.

    @Drekin
    Copy link
    Mannequin Author

    Drekin mannequin commented Jul 26, 2015

    Just out of my curiosity – why is not this issue listed in Python 3.5b4 changelog even though the issue is fixed there?

    @berkerpeksag
    Copy link
    Member

    Could you please share the link of the changelog you've mentioned? Unless I'm missing something, this issue is already listed in the changelog: https://hg.python.org/releasing/3.5/file/f65605b99cb4/Misc/NEWS#l37

    @Drekin
    Copy link
    Mannequin Author

    Drekin mannequin commented Jul 26, 2015

    @berkerpeksag
    Copy link
    Member

    Looks like a cache issue. I've just fixed it: https://docs.python.org/3.5/whatsnew/changelog.html

    @Drekin
    Copy link
    Mannequin Author

    Drekin mannequin commented Jul 26, 2015

    Ok, thanks.

    @iritkatriel
    Copy link
    Member

    The patch here added a reference from TracebackException to the actual traceback, which I think should be removed. Please see this issue: https://bugs.python.org/issue42482

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants