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
Comments
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. |
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? |
Here is a patch. I was pretty sure that I've already created an issue for this but couldn't find it now. |
This patch looks correct, applies cleanly, and passes tests. |
New changeset b45077269aaa by Berker Peksag in branch '3.5': New changeset 2825c87d3f72 by Berker Peksag in branch 'default': |
Fixed in 3.5 and default branches. Thank you for your review, Raymond. |
Thank you all for a quick reaction. |
Just out of my curiosity – why is not this issue listed in Python 3.5b4 changelog even though the issue is fixed there? |
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 |
I meant this one: https://docs.python.org/3.5/whatsnew/changelog.html#python-3-5-beta-4 . |
Looks like a cache issue. I've just fixed it: https://docs.python.org/3.5/whatsnew/changelog.html |
Ok, thanks. |
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 |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: