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: Bugs in PyTraceBack_Print()
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: berker.peksag, christian.heimes, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-11-05 14:06 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4289 merged serhiy.storchaka, 2017-11-05 14:16
PR 4406 merged serhiy.storchaka, 2017-11-15 15:46
Messages (4)
msg305595 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-05 14:06
0fbab7ff8d2efd92e222fcc13c0aff0998c3c158 changed the semantic of PyTraceBack_Print and sys.tracebacklimit. It no longer match the documentation and the behavior of the traceback module. Setting sys.tracebacklimit to 0 or less no longer suppress printing tracebacks in PyTraceBack_Print(). Setting sys.tracebacklimit to None (as at shutdown stage) no longer makes PyTraceBack_Print() using default limit, but suppress printing tracebacks and sets a TypeError without returning failure from PyTraceBack_Print().

The proposed PR restores the initial purposed semantic and fixes several other bugs in PyTraceBack_Print().

* Setting sys.tracebacklimit to 0 or less now suppress printing tracebacks.
* Setting sys.tracebacklimit to None now causes using the default limit.
* Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using the limit LONG_MAX rather than the default limit.
* Fixed integer overflows in the case of more than 2**31 items on Windows.
* Fixed output errors handling.
msg305596 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2017-11-05 14:23
> Setting sys.tracebacklimit to 0 or less no longer suppress printing
> tracebacks in PyTraceBack_Print().

This was also reported in issue 12276.
msg306274 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-15 15:38
New changeset edad8eebeee3c99e324a7f1ac5073167c2b0b54d by Serhiy Storchaka in branch 'master':
bpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). (#4289)
https://github.com/python/cpython/commit/edad8eebeee3c99e324a7f1ac5073167c2b0b54d
msg306280 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-15 16:04
New changeset 3864248866d6224336c7be49670447cb4d125cd6 by Serhiy Storchaka in branch '3.6':
[3.6] bpo-31949: Fixed several issues in printing tracebacks (PyTraceBack_Print()). (GH-4289) (#4406)
https://github.com/python/cpython/commit/3864248866d6224336c7be49670447cb4d125cd6
History
Date User Action Args
2022-04-11 14:58:54adminsetgithub: 76130
2018-09-22 19:12:11serhiy.storchakasetpull_requests: - pull_request4257
2017-11-20 18:05:52serhiy.storchakalinkissue12276 superseder
2017-11-15 16:05:18serhiy.storchakasetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.6
2017-11-15 16:04:48serhiy.storchakasetmessages: + msg306280
2017-11-15 15:46:39serhiy.storchakasetpull_requests: + pull_request4355
2017-11-15 15:38:54serhiy.storchakasetmessages: + msg306274
2017-11-06 16:36:43serhiy.storchakasetpull_requests: + pull_request4257
2017-11-05 14:23:50berker.peksagsetnosy: + berker.peksag
messages: + msg305596
2017-11-05 14:16:19serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request4252
2017-11-05 14:06:35serhiy.storchakacreate