summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.8] bpo-34463: Make python tracebacks identical to C tracebacks for (#23899)Irit Katriel2021-04-261-5/+9
| | | | | | | | | | | | | | * [3.8] bpo-34463: Make python tracebacks identical to C tracebacks for SyntaxErrors without a lineno (GH-23427) (cherry picked from commit 069560b1171eb6385121ff3b6331e8814a4e7454) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com> * 📜🤖 Added by blurb_it. * added missing newline in test Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-42482: remove reference to exc_traceback from TracebackException (GH-23531)Miss Islington (bot)2020-12-011-3/+2
| | | | | (cherry picked from commit 427613f005f0f412d12f0d775d2b609bae0ae1ad) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
* Fix typo in Lib/tracepack.py (GH-19605)Miss Islington (bot)2020-04-201-1/+1
| | | | | | Typo fix: "emites" -> "emit". (cherry picked from commit df8913f7c48d267efd662e8ffd9496595115eee8) Co-authored-by: Galden <wudenggang0@163.com>
* bpo-26502: Implement FrameSummary.__len__() (GH-8632)Berker Peksag2018-09-101-0/+3
|
* bpo-34588: Fix an off-by-one error in traceback formatting. (GH-9077)Benjamin Peterson2018-09-101-10/+19
| | | | | | | | The recursive frame pruning code always undercounted the number of elided frames by one. That is, in the "[Previous line repeated N more times]" message, N would always be one too few. Near the recursive pruning cutoff, one frame could be silently dropped. That situation is demonstrated in the OP of the bug report. The fix is to start the identical frame counter at 1.
* bpo-27910: Update documentation of traceback module (GH-6116)torsava2018-08-021-13/+16
| | | | | | | | | | In the documentation for the traceback module, the definitions of functions extract_tb(), format_list() and classmethod StackSummary.from_list() mention the old style 4-tuples that these functions used to return or accept. Since Python 3.5, however, they return or accept a FrameSummary object instead of a 4-tuple, or a StackSummary object instead of a list of 4-tuples. Co-Authored-By: Berker Peksag <berker.peksag@gmail.com>
* bpo-28603: Fix formatting tracebacks for unhashable exceptions (#4014)Zane Bitter2017-10-171-3/+3
|
* bpo-30296 Remove unnecessary tuples, lists, sets, and dicts (#1489)Jon Dufresne2017-05-181-2/+1
| | | | | | | | * Replaced list(<generator expression>) with list comprehension * Replaced dict(<generator expression>) with dict comprehension * Replaced set(<list literal>) with set literal * Replaced builtin func(<list comprehension>) with func(<generator expression>) when supported (e.g. any(), all(), tuple(), min(), & max())
* Issue #27348: Merge exception formatting fix from 3.5 into 3.6Martin Panter2016-09-221-1/+1
|\
| * Issue #27348: Restore “Exception: None” formatting in traceback moduleMartin Panter2016-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression caused by revision 73afda5a4e4c. Also reverts the decimal test workaround added in revision 5f3dd0a2b1ab. Remove test_without_exception(). According to revision ecaafc32c500, this was added in Python 2 so that print_exc() would output “None” when called with no exception set. However print_exc() never worked like this in Python 3, and the use case is not documented. Restore TracebackCases class name (instead of SyntaxTracebackCases), because the class also tests other exceptions.
* | Issue 27948: Allow backslashes in the literal string portion of f-strings, ↵Eric V. Smith2016-09-101-2/+2
| | | | | | | | but not in the expressions. Also, require expressions to begin and end with literal curly braces.
* | Issue 27921: Remove backslash from another f-string. I'll revert this change ↵Eric V. Smith2016-09-031-2/+2
| | | | | | | | before beta 2. I also need to look in to why test_tools/test_unparse fails with the files that are now being skipped.
* | Closes issue 27921: Disallow backslashes anywhere in f-strings. This is a ↵Eric V. Smith2016-09-031-2/+2
| | | | | | | | temporary restriction. In 3.6 beta 2, the plan is to again allow backslashes in the string parts of f-strings, but disallow them in the expression parts.
* | Issue #26823: Abbreviate recursive tracebacksNick Coghlan2016-08-151-0/+23
| | | | | | | | | | | | | | | | 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.
* | Issue #27076: Merge spelling from 3.5Martin Panter2016-05-261-5/+5
|\ \ | |/
| * Issue #27076: Doc, comment and tests spelling fixesMartin Panter2016-05-261-5/+5
| | | | | | | | Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
* | Issue #25111: Fixed comparison of traceback.FrameSummary.Serhiy Storchaka2015-09-291-4/+8
|\ \ | |/
| * Issue #25111: Fixed comparison of traceback.FrameSummary.Serhiy Storchaka2015-09-291-4/+8
| |
* | Issue #25108: Omitted internal frames in traceback functions print_stack(),Serhiy Storchaka2015-09-181-0/+6
|\ \ | |/ | | | | format_stack(), and extract_stack() called without arguments.
| * Issue #25108: Omitted internal frames in traceback functions print_stack(),Serhiy Storchaka2015-09-181-0/+6
| | | | | | | | format_stack(), and extract_stack() called without arguments.
* | Issue #24710: Use cls in TracebackException.from_exception.Robert Collins2015-07-251-3/+2
|/ | | | Minor cleanup patch from Berker Peksag.
* Issue #24695: Fix a regression in traceback.print_exception()Berker Peksag2015-07-241-1/+3
| | | | | If exc_traceback is None we shouldn't print a traceback header like described in the documentation.
* Issue #22619: Added negative limit support in the traceback module.Serhiy Storchaka2015-05-031-4/+10
| | | | Based on patch by Dmitry Kazakov.
* Issue #23883: Add missing entries to traceback.__all__.Berker Peksag2015-04-081-2/+3
|
* Issue #23631: Fix traceback.format_list when a traceback has been mutated.Robert Collins2015-03-161-4/+10
|
* Issue #22936: Make it possible to show local variables in tracebacks.Robert Collins2015-03-051-16/+32
|
* Remaining fallout from 17911Robert Collins2015-03-051-2/+8
| | | | | | | | | | | | | The code module was using a private function from traceback in order to skip a frame - used the direct interface to do that instead, The decimal module suffered minor fallout from formatting changes ('None' as a value is now not printed by traceback, the same as None was not before). The cgitb module was passing a bogus exception type (type.__name__) into format_exception, which uncovered that format_exception and print_exception had been ignoring the etype for some time, so the compatibility thunk to the new code now does the same thing.
* Issue #17911: traceback module overhaulRobert Collins2015-03-041-133/+351
| | | | | | | | | Provide a way to seed the linecache for a PEP-302 module without actually loading the code. Provide a new object API for traceback, including the ability to not lookup lines at all until the traceback is actually rendered, without any trace of the original objects being kept alive.
* Issue #22032: __qualname__ instead of __name__ is now always used to formatSerhiy Storchaka2014-07-221-1/+1
| | | | fully qualified class names of Python implemented classes.
* Issue #17825: Cursor ^ is correctly positioned for SyntaxError and ↵Florent Xicluna2014-01-221-3/+4
|\ | | | | | | IndentationError.
| * Issue #17825: Cursor ^ is correctly positioned for SyntaxError and ↵Florent Xicluna2014-01-221-3/+4
| | | | | | | | IndentationError.
* | merge with 3.3Georg Brandl2013-10-131-1/+1
|\ \ | |/
| * Closes #16657: fix docstring of traceback.format_tb().Georg Brandl2013-10-131-1/+1
| |
* | #1565525: Add traceback.clear_frames() helper function to clear locals ref'd ↵Andrew Kuchling2013-09-151-1/+12
| | | | | | | | by a traceback
* | refactor traceback.py to reduce code duplication (closes #17646)Benjamin Peterson2013-04-291-143/+104
| | | | | | | | Patch by Martin Morrison.
* | utilize yield fromPhilip Jenvey2012-10-011-2/+1
|/
* PEP 415: Implement suppression of __context__ display with an exception ↵Benjamin Peterson2012-05-151-6/+7
| | | | | | attribute This replaces the original PEP 409 implementation. See #14133.
* Close issue #6210: Implement PEP 409Nick Coghlan2012-02-261-4/+4
|
* Issue #4486: When an exception has an explicit cause, do not print its ↵Antoine Pitrou2009-11-281-4/+5
| | | | implicit context too.
* Small PEP8 correction.Georg Brandl2009-09-161-3/+3
|
* Merged revisions 73186,73206,73212 via svnmerge fromGeorg Brandl2009-06-041-1/+1
| | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r73186 | georg.brandl | 2009-06-03 23:21:09 +0200 (Mi, 03 Jun 2009) | 1 line #6174: fix indentation in code example. ........ r73206 | georg.brandl | 2009-06-04 11:15:12 +0200 (Do, 04 Jun 2009) | 1 line #3584: ignore trailing newlines when placing the caret for a SyntaxError location. ........ r73212 | georg.brandl | 2009-06-04 12:10:41 +0200 (Do, 04 Jun 2009) | 1 line Better name for "Ctor". ........
* Merged revisions 71237-71238 via svnmerge fromGeorg Brandl2009-04-051-4/+3
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r71237 | georg.brandl | 2009-04-05 16:24:52 +0200 (So, 05 Apr 2009) | 1 line #1326077: fix traceback formatting of SyntaxErrors. This fixes two differences with formatting coming from Python: a) the reproduction of location details in the error message if no line text is given, b) the prefixing of the last line by one space. ........ r71238 | georg.brandl | 2009-04-05 16:25:41 +0200 (So, 05 Apr 2009) | 1 line Add NEWS entry for r71237. ........
* Merged revisions ↵Benjamin Peterson2009-03-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 70554,70588-70589,70598,70605,70611-70621,70623-70624,70626-70627 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r70554 | benjamin.peterson | 2009-03-23 16:25:15 -0500 (Mon, 23 Mar 2009) | 1 line complain when there's no last exception ........ r70588 | benjamin.peterson | 2009-03-24 17:56:32 -0500 (Tue, 24 Mar 2009) | 1 line fix newline issue in test summary ........ r70589 | benjamin.peterson | 2009-03-24 18:07:07 -0500 (Tue, 24 Mar 2009) | 1 line another style nit ........ r70598 | benjamin.peterson | 2009-03-25 16:24:04 -0500 (Wed, 25 Mar 2009) | 1 line add shorthands for expected failures and unexpected success ........ r70605 | benjamin.peterson | 2009-03-26 11:32:23 -0500 (Thu, 26 Mar 2009) | 1 line remove uneeded function ........ r70611 | benjamin.peterson | 2009-03-26 13:35:37 -0500 (Thu, 26 Mar 2009) | 1 line add much better tests for python version information parsing ........ r70612 | benjamin.peterson | 2009-03-26 13:55:48 -0500 (Thu, 26 Mar 2009) | 1 line more and more implementations now support sys.subversion ........ r70613 | benjamin.peterson | 2009-03-26 13:58:30 -0500 (Thu, 26 Mar 2009) | 1 line roll old test in with new one ........ r70614 | benjamin.peterson | 2009-03-26 14:09:21 -0500 (Thu, 26 Mar 2009) | 1 line add support for PyPy ........ r70615 | benjamin.peterson | 2009-03-26 14:58:18 -0500 (Thu, 26 Mar 2009) | 5 lines add some useful utilities for skipping tests with unittest's new skipping ability most significantly apply a modified portion of the patch from #4242 with patches for skipping implementation details ........ r70616 | benjamin.peterson | 2009-03-26 15:05:50 -0500 (Thu, 26 Mar 2009) | 1 line rename TestCase.skip() to skipTest() because it causes annoying problems with trial #5571 ........ r70617 | benjamin.peterson | 2009-03-26 15:17:27 -0500 (Thu, 26 Mar 2009) | 1 line apply the second part of #4242's patch; classify all the implementation details in test_descr ........ r70618 | benjamin.peterson | 2009-03-26 15:48:25 -0500 (Thu, 26 Mar 2009) | 1 line remove test_support.TestSkipped and just use unittest.SkipTest ........ r70619 | benjamin.peterson | 2009-03-26 15:49:40 -0500 (Thu, 26 Mar 2009) | 1 line fix naming ........ r70620 | benjamin.peterson | 2009-03-26 16:10:30 -0500 (Thu, 26 Mar 2009) | 1 line fix incorrect auto-translation of TestSkipped -> unittest.SkipTest ........ r70621 | benjamin.peterson | 2009-03-26 16:11:16 -0500 (Thu, 26 Mar 2009) | 1 line must pass argument to get expected behavior ;) ........ r70623 | benjamin.peterson | 2009-03-26 16:30:10 -0500 (Thu, 26 Mar 2009) | 1 line add missing import ........ r70624 | benjamin.peterson | 2009-03-26 16:30:54 -0500 (Thu, 26 Mar 2009) | 1 line ** is required here ........ r70626 | benjamin.peterson | 2009-03-26 16:40:29 -0500 (Thu, 26 Mar 2009) | 1 line update email tests to use SkipTest ........ r70627 | benjamin.peterson | 2009-03-26 16:44:43 -0500 (Thu, 26 Mar 2009) | 1 line fix another name ........
* Remove unnecessary importNeal Norwitz2008-12-071-1/+0
|
* Issue #3812: Failed to build python if configure --without-threads.Hirokazu Yamamoto2008-09-091-2/+4
| | | | | | | | Removed itertools usage from Lib/traceback.py, because itertools is extension module, so maybe unavailable on build process. (Lib/_dummy_thread.py uses Lib/traceback.py) Reviewed by Amaury Forgeot d'Arc.
* implement chained exception tracebacksBenjamin Peterson2008-07-151-21/+63
| | | | patch from Antoine Pitrou #3112
* Remove function obsolete since Python 2.3 from traceback module.Georg Brandl2008-05-121-8/+1
|
* #1535: rename __builtin__ module to builtins.Georg Brandl2007-12-021-1/+1
|
* Merged revisions 56492-56752 via svnmerge fromGuido van Rossum2007-08-051-20/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r56497 | kurt.kaiser | 2007-07-22 14:55:16 -0700 (Sun, 22 Jul 2007) | 4 lines In the case of syntax errors, in py3k format_exception_only() was including line number and position in the final line of the exception notification, duplicating info in previous lines. ........ r56501 | kurt.kaiser | 2007-07-22 19:35:50 -0700 (Sun, 22 Jul 2007) | 2 lines Hum, needed a newline in the last change. ........ r56536 | kurt.kaiser | 2007-07-24 19:06:48 -0700 (Tue, 24 Jul 2007) | 5 lines Not all instantiations of SyntaxError set the args attribute. e.g. symtable.c Modify format_exception_only() to get SyntaxError attributes directly instead of unpacking 'args'. ........ r56537 | kurt.kaiser | 2007-07-24 19:13:03 -0700 (Tue, 24 Jul 2007) | 3 lines Update doctest strings: traceback.py no longer prints redundant location information in the last line of the exception display. ........ r56627 | kurt.kaiser | 2007-07-29 21:06:57 -0700 (Sun, 29 Jul 2007) | 2 lines Interactive interpreter emulator (code.py) failing to print exceptions. ........ r56628 | kurt.kaiser | 2007-07-29 21:41:02 -0700 (Sun, 29 Jul 2007) | 2 lines Eliminate extra lines before and after tracebacks. ........ r56638 | kurt.kaiser | 2007-07-31 19:36:45 -0700 (Tue, 31 Jul 2007) | 3 lines Refactor syntax error display in shell and edit windows; move colorize_syntax_error() to EditorWindow; update to py3k. ........ r56685 | neal.norwitz | 2007-08-02 22:20:23 -0700 (Thu, 02 Aug 2007) | 10 lines Remove several h/w and o/s specific modules that are undocumented, obsolete, and/or not widely used: linuxaudiodev.c, sunaudiodev.c Lib/plat-sunos5/SUNAUDIODEV.py Lib/audiodev.py Tools/audiopy/audiopy Move Lib/toaiff.py to Demo. See PEP 3108 for most of the details. ........ r56686 | neal.norwitz | 2007-08-02 22:21:48 -0700 (Thu, 02 Aug 2007) | 4 lines Missed one module that should have been removed since it relied on audiodev which was removed. ........ r56748 | neal.norwitz | 2007-08-04 19:19:04 -0700 (Sat, 04 Aug 2007) | 1 line Make from X import * outside module scope an error. ........ r56750 | neal.norwitz | 2007-08-04 19:35:01 -0700 (Sat, 04 Aug 2007) | 1 line Use READONLY consistently instead of RO ........
* Remove the ability to slice/index on exceptions per PEP 352.Brett Cannon2007-02-271-1/+1
|