summaryrefslogtreecommitdiffstats
path: root/Doc/library/traceback.rst
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2016-08-15 03:11:34 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2016-08-15 03:11:34 (GMT)
commitd00342347e467981b52368235b99a22dc264dab1 (patch)
treee7ea356a2c4e93f592fd7f3e52e12dfeccfaf13e /Doc/library/traceback.rst
parentd61a2e75b5218f0f89b4f623713004edb9512180 (diff)
downloadcpython-d00342347e467981b52368235b99a22dc264dab1.zip
cpython-d00342347e467981b52368235b99a22dc264dab1.tar.gz
cpython-d00342347e467981b52368235b99a22dc264dab1.tar.bz2
Issue #26823: Abbreviate recursive tracebacks
Large sections of repeated lines in tracebacks are now abbreviated as "[Previous line repeated {count} more times]" by both the traceback module and the builtin traceback rendering. Patch by Emanuel Barry.
Diffstat (limited to 'Doc/library/traceback.rst')
-rw-r--r--Doc/library/traceback.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst
index 3c1d9bb..5336294 100644
--- a/Doc/library/traceback.rst
+++ b/Doc/library/traceback.rst
@@ -291,6 +291,21 @@ capture data for later printing in a lightweight fashion.
of tuples. Each tuple should be a 4-tuple with filename, lineno, name,
line as the elements.
+ .. method:: format()
+
+ Returns a list of strings ready for printing. Each string in the
+ resulting list corresponds to a single frame from the stack.
+ Each string ends in a newline; the strings may contain internal
+ newlines as well, for those items with source text lines.
+
+ For long sequences of the same frame and line, the first few
+ repetitions are shown, followed by a summary line stating the exact
+ number of further repetitions.
+
+ .. versionchanged:: 3.6
+
+ Long sequences of repeated frames are now abbreviated.
+
:class:`FrameSummary` Objects
-----------------------------