[New-bugs-announce] [issue31949] Bugs in PyTraceBack_Print()

Serhiy Storchaka report at bugs.python.org
Sun Nov 5 09:06:35 EST 2017


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

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.

----------
assignee: serhiy.storchaka
components: Interpreter Core
messages: 305595
nosy: christian.heimes, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Bugs in PyTraceBack_Print()
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31949>
_______________________________________


More information about the New-bugs-announce mailing list