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.

classification
Title: Don't print traceback header if traceback is None in TracebackException
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Drekin, berker.peksag, iritkatriel, python-dev, rbcollins, rhettinger
Priority: normal Keywords: patch

Created on 2015-07-23 14:42 by Drekin, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue24695.diff berker.peksag, 2015-07-23 20:56 review
Messages (13)
msg247208 - (view) Author: Adam Bartoš (Drekin) * Date: 2015-07-23 14:42
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.
msg247220 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2015-07-23 16:16
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?
msg247231 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-07-23 20:56
Here is a patch. I was pretty sure that I've already created an issue for this but couldn't find it now.
msg247241 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2015-07-24 03:26
This patch looks correct, applies cleanly, and passes tests.
msg247277 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-07-24 14:38
New changeset b45077269aaa by Berker Peksag in branch '3.5':
Issue #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 #24695: Fix a regression in traceback.print_exception()
https://hg.python.org/cpython/rev/2825c87d3f72
msg247278 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-07-24 14:39
Fixed in 3.5 and default branches. Thank you for your review, Raymond.
msg247279 - (view) Author: Adam Bartoš (Drekin) * Date: 2015-07-24 14:51
Thank you all for a quick reaction.
msg247434 - (view) Author: Adam Bartoš (Drekin) * Date: 2015-07-26 15:58
Just out of my curiosity – why is not this issue listed in Python 3.5b4 changelog even though the issue is fixed there?
msg247436 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-07-26 16:27
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
msg247437 - (view) Author: Adam Bartoš (Drekin) * Date: 2015-07-26 16:41
I meant this one: https://docs.python.org/3.5/whatsnew/changelog.html#python-3-5-beta-4 .
msg247441 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-07-26 17:09
Looks like a cache issue. I've just fixed it: https://docs.python.org/3.5/whatsnew/changelog.html
msg247443 - (view) Author: Adam Bartoš (Drekin) * Date: 2015-07-26 17:16
Ok, thanks.
msg381939 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2020-11-27 10:14
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
History
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 68883
2020-11-27 10:14:41iritkatrielsetnosy: + iritkatriel
messages: + msg381939
2015-07-26 17:16:29Drekinsetmessages: + msg247443
2015-07-26 17:09:56berker.peksagsetmessages: + msg247441
2015-07-26 16:41:45Drekinsetmessages: + msg247437
2015-07-26 16:27:32berker.peksagsetmessages: + msg247436
2015-07-26 15:58:57Drekinsetmessages: + msg247434
2015-07-24 14:51:10Drekinsetmessages: + msg247279
2015-07-24 14:39:03berker.peksagsetstatus: open -> closed
resolution: fixed
messages: + msg247278

stage: patch review -> resolved
2015-07-24 14:38:02python-devsetnosy: + python-dev
messages: + msg247277
2015-07-24 03:26:07rhettingersetnosy: + rhettinger
messages: + msg247241
2015-07-23 20:56:15berker.peksagsetfiles: + issue24695.diff

nosy: + berker.peksag
messages: + msg247231

keywords: + patch
stage: needs patch -> patch review
2015-07-23 16:16:04rbcollinssetmessages: + msg247220
2015-07-23 15:21:45berker.peksagsetnosy: + rbcollins
2015-07-23 14:58:43r.david.murraysettitle: Don't print traceback header if traceback is None -> Don't print traceback header if traceback is None in TracebackException
stage: needs patch
versions: + Python 3.6
2015-07-23 14:42:19Drekincreate