summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-111388: Add `show_group` parameter to `traceback.format_exception_only` ↵Nikita Sobolev2023-10-271-6/+25
| | | | (#111390)
* bpo-43950: handle wide unicode characters in tracebacks (#28150)Batuhan Taskaya2023-10-261-12/+41
|
* gh-67224: Show source lines in tracebacks when using the -c option when ↵Pablo Galindo Salgado2023-10-261-6/+5
| | | | running Python (#111200)
* gh-111157: Mention `__notes__` in `traceback.format_exception_only` ↵Nikita Sobolev2023-10-211-15/+12
| | | | docstring (#111158)
* gh-110805: Allow the repl to show source code and complete tracebacks (#110775)Pablo Galindo Salgado2023-10-131-3/+7
|
* gh-110721: Use the traceback module for PyErr_Display() and fallback to the ↵Pablo Galindo Salgado2023-10-121-5/+21
| | | | C implementation (#110702)
* gh-106922: Fix error location for constructs with spaces and parentheses ↵Pablo Galindo Salgado2023-09-081-3/+13
| | | | (#108959)
* gh-105292: Add option to make ↵Irit Katriel2023-06-061-6/+12
| | | | | | | traceback.TracebackException.format_exception_only recurse into exception groups (#105294) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-89412: Add missing attributes (added in 3.10) to traceback module docs ↵Jakub Kuczys2023-06-051-2/+2
| | | | (#105046)
* GH-89455: Add missing attributes (added in 3.11) to traceback module docs ↵Jakub Kuczys2023-05-291-0/+2
| | | | (#105044)
* gh-102799: replace sys.exc_info by sys.exception in inspect and traceback ↵Irit Katriel2023-05-011-3/+3
| | | | modules (#104032)
* gh-103895: Improve how invalid `Exception.__notes__` are displayed (#103897)Carey Metcalfe2023-05-011-2/+6
|
* gh-102778: Add sys.last_exc, deprecate sys.last_type, ↵Irit Katriel2023-03-181-6/+10
| | | | sys.last_value,sys.last_traceback (#102779)
* gh-99103: Normalize specialized traceback anchors against the current line ↵Batuhan Taskaya2022-11-121-4/+9
| | | | | (GH-99145) Automerge-Triggered-By: GH:isidentical
* gh-99139: Improve NameError error suggestion for instances (#99140)Pablo Galindo Salgado2022-11-061-0/+10
|
* gh-98878: Use builtins from the bound frame when offering a suggestion (#98880)Batuhan Taskaya2022-10-311-1/+1
|
* gh-98744: Prevent column-level decoding crashes on traceback module (#98824)Batuhan Taskaya2022-10-291-14/+11
|
* gh-91058: Add error suggestions to 'import from' import errors (#98305)Pablo Galindo Salgado2022-10-251-3/+15
|
* gh-98254: Include stdlib module names in error messages for NameErrors (#98255)Pablo Galindo Salgado2022-10-151-0/+7
|
* gh-97008: Add a Python implementation of AttributeError and NameError ↵Łukasz Langa2022-10-041-0/+127
| | | | | | | | | suggestions (#97022) Relevant tests moved from test_exceptions to test_traceback to be able to compare both implementations. Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
* gh-87822: Make traceback module robust to exceptions from repr() of local ↵Simon-Martin Schröder2022-07-111-1/+2
| | | | values (GH-94691)
* gh-93883: elide traceback indicators when possible (#93994)John Belmonte2022-07-111-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gh-93883: elide traceback indicators when possible Elide traceback column indicators when the entire line of the frame is implicated. This reduces traceback length and draws even more attention to the remaining (very relevant) indicators. Example: ``` Traceback (most recent call last): File "query.py", line 99, in <module> bar() File "query.py", line 66, in bar foo() File "query.py", line 37, in foo magic_arithmetic('foo') File "query.py", line 18, in magic_arithmetic return add_counts(x) / 25 ^^^^^^^^^^^^^ File "query.py", line 24, in add_counts return 25 + query_user(user1) + query_user(user2) ^^^^^^^^^^^^^^^^^ File "query.py", line 32, in query_user return 1 + query_count(db, response['a']['b']['c']['user'], retry=True) ~~~~~~~~~~~~~~~~~~^^^^^ TypeError: 'NoneType' object is not subscriptable ``` Rather than going out of our way to provide indicator coverage in every traceback test suite, the indicator test suite should be responible for sufficient coverage (e.g. by adding a basic exception group test to ensure that margin strings are covered).
* gh-89770: Implement PEP-678 - Exception notes (GH-31317)Irit Katriel2022-04-161-10/+14
|
* bpo-45615: Add missing test for printing traceback for non-exception. Fix ↵Irit Katriel2022-01-021-1/+5
| | | | traceback.py (GH-30091)
* bpo-45607: Make it possible to enrich exception displays via setting their ↵Irit Katriel2021-12-031-0/+4
| | | | __note__ field (GH-29880)
* bpo-45614: Fix traceback display for exceptions with invalid module name ↵Irit Katriel2021-11-271-0/+2
| | | | (GH-29726)
* bpo-45292: [PEP 654] Update traceback display code to work with exception ↵Irit Katriel2021-11-051-13/+128
| | | | groups (GH-29207)
* bpo-45249: Fix caret location when end_offset is set to 0 (GH-28855)Pablo Galindo Salgado2021-10-161-1/+1
|
* bpo-45249: Ensure the traceback module prints correctly syntax errors with ↵Pablo Galindo Salgado2021-09-271-6/+21
| | | | ranges (GH-28575)
* bpo-41031: Match C and Python code formatting of unprintable exceptions and ↵Irit Katriel2021-09-051-1/+1
| | | | exceptions in the __main__ module. (GH-28139)
* bpo-45075: distinguish between frame and FrameSummary in traceback mo… ↵Irit Katriel2021-09-031-29/+33
| | | | (GH-28112)
* bpo-31299: make it possible to filter out frames from tracebacks (GH-28067)Irit Katriel2021-08-311-0/+3
|
* bpo-43950: support some multi-line expressions for PEP 657 (GH-27339)Batuhan Taskaya2021-07-251-8/+10
| | | | | | | | | | | | | | | | | | | | | This is basically something that I noticed up while fixing test runs for another issue. It is really common to have multiline calls, and when they fail the display is kind of weird since we omit the annotations. E.g; ``` $ ./python t.py Traceback (most recent call last): File "/home/isidentical/cpython/cpython/t.py", line 11, in <module> frame_1() ^^^^^^^^^ File "/home/isidentical/cpython/cpython/t.py", line 5, in frame_1 frame_2( File "/home/isidentical/cpython/cpython/t.py", line 2, in frame_2 return a / 0 / b / c ~~^~~ ZeroDivisionError: division by zero ``` This patch basically adds support for annotating the rest of the line, if the instruction covers multiple lines (start_line != end_line). Automerge-Triggered-By: GH:isidentical
* bpo-43950: support long lines in traceback.py (GH-27336)Batuhan Taskaya2021-07-241-1/+5
|
* bpo-44569: Decouple frame formatting in traceback.py (GH-27038)Ammar Askar2021-07-161-34/+44
|
* bpo-43950: make BinOp specializations more reliable (GH-27126)Batuhan Taskaya2021-07-151-1/+1
|
* bpo-43950: Specialize tracebacks for subscripts/binary ops (GH-27037)Batuhan Taskaya2021-07-121-1/+59
| | | | Co-authored-by: Ammar Askar <ammar@ammaraskar.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* bpo-44446: support lineno being None in traceback.FrameSummary (GH-26781)Filipe Laíns2021-07-081-0/+2
| | | | | | As of 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b, lineno is None instead of -1 if there is no line number. Signed-off-by: Filipe Laíns <lains@riseup.net>
* bpo-43950: Print columns in tracebacks (PEP 657) (GH-26958)Ammar Askar2021-07-041-10/+79
| | | | | | | | The traceback.c and traceback.py mechanisms now utilize the newly added code.co_positions and PyCode_Addr2Location to print carets on the specific expressions involved in a traceback. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com> Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
* bpo-43024: improve signature (in help, etc) for functions taking sent… ↵Irit Katriel2021-06-171-1/+4
| | | | | (GH-24331) …inel defaults
* bpo-33809: add the TracebackException.print() method (GH-24231)Irit Katriel2021-05-221-4/+8
|
* bpo-43146: fix None-handling in single-arg traceback.print_exception(None) ↵Irit Katriel2021-02-231-1/+4
| | | | | (GH-24629) (The previous commit fixed print_exception(None, None, None).)
* bpo-43146: fix regression in traceback.print_exception(None) (GH-24463)Irit Katriel2021-02-231-1/+3
|
* bpo-42877: add the 'compact' param to TracebackException's __init__ (#24179)Irit Katriel2021-01-151-9/+16
| | | Use it to reduce the time and memory taken up by several of traceback's module-level functions.
* bpo-42848: remove recursion from TracebackException (GH-24158)Irit Katriel2021-01-121-46/+69
|
* bpo-34463: Make python tracebacks identical to C tracebacks for SyntaxErrors ↵Irit Katriel2020-12-221-5/+9
| | | | without a lineno (GH-23427)
* bpo-42482: remove reference to exc_traceback from TracebackException (GH-23531)Irit Katriel2020-12-011-3/+2
|
* bpo-26389: Allow passing an exception object in the traceback module (GH-22610)Zackery Spytz2020-11-051-13/+23
| | | | | | The format_exception(), format_exception_only(), and print_exception() functions can now take an exception object as a positional-only argument. Co-Authored-By: Matthias Bussonnier <bussonniermatthias@gmail.com>
* bpo-40612: Fix SyntaxError edge cases in traceback formatting (GH-20072)Guido van Rossum2020-05-151-11/+18
| | | | | | | | | | | | | This fixes both the traceback.py module and the C code for formatting syntax errors (in Python/pythonrun.c). They now both consistently do the following: - Suppress caret if it points left of text - Allow caret pointing just past end of line - If caret points past end of line, clip to *just* past end of line The syntax error formatting code in traceback.py was mostly rewritten; small, subtle changes were applied to the C code in pythonrun.c. There's still a difference when the text contains embedded newlines. Neither handles these very well, and I don't think the case occurs in practice. Automerge-Triggered-By: @gvanrossum
* Fix typo in Lib/tracepack.py (GH-19605)Galden2020-04-201-1/+1
| | | Typo fix: "emites" -> "emit".