summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_traceback.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-113358: Fix rendering tracebacks with exceptions with a broken ↵Jérome Perrin2024-01-191-0/+15
| | | | __getattr__ (GH-113359) (#114118)
* [3.11] bpo-43950: handle wide unicode characters in tracebacks (GH-28150) ↵Pablo Galindo Salgado2023-10-271-1/+56
| | | | (#111373)
* [3.11] gh-109179: Fix traceback display for SyntaxErrors with notes ↵Irit Katriel2023-09-121-21/+22
| | | | | | | (#109197) (#109283) gh-109179: Fix traceback display for SyntaxErrors with notes (#109197) (cherry picked from commit ecd21a629a2a30bcae89902f7cad5670e9441e2c)
* [3.11] gh-106922: Fix error location for constructs with spaces and ↵Miss Islington (bot)2023-09-081-0/+36
| | | | | | parentheses (GH-108959) (#109148) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.11] gh-99103: Normalize specialized traceback anchors against the current ↵Batuhan Taskaya2022-11-211-0/+34
| | | | | | | | | | line (#99423) [3.11] gh-99103: Normalize specialized traceback anchors against the current line (GH-99145) Automerge-Triggered-By: GH:isidentical. (cherry picked from commit 57be5459593bbd09583317ebdafc4d58ae51dbf4) Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* [3.11] gh-98744: Prevent column-level decoding crashes on traceback module ↵Batuhan Taskaya2022-10-291-0/+50
| | | | | (#98850) Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* [3.11] gh-93883: elide traceback indicators when possible (GH-93994) (GH-94740)John Belmonte2022-07-111-100/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Elide traceback column indicators when the entire line of the frame is implicated. This reduces traceback length and draws 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 ``` Automerge-Triggered-By: GH:pablogsal
* [3.11] GH-94694: Fix column offsets for multi-line method lookups (GH-94721)Brandt Bucher2022-07-101-0/+51
| | | (cherry picked from commit 264b3ddfd561d97204ffb30be6a7d1fb0555e560)
* GH-93249: relax overly strict assertion on bounds->ar_start (GH-93961) ↵Miss Islington (bot)2022-06-201-1/+27
| | | | | | | | | (GH-94032) (cherry picked from commit 1603a1029f44f0fdc87c65b02063229962194f84) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* GH-88116: Use a compact format to represent end line and column offsets. ↵Mark Shannon2022-04-211-0/+1
| | | | | | | | | | | | (GH-91666) * Stores all location info in linetable to conform to PEP 626. * Remove column table from code objects. * Remove end-line table from code objects. * Document new location table format
* gh-89770: Implement PEP-678 - Exception notes (GH-31317)Irit Katriel2022-04-161-38/+155
|
* bpo-46729: add number of sub-exceptions in str() of BaseExceptionGroup ↵Irit Katriel2022-02-221-28/+28
| | | | (GH-31294)
* bpo-46098: Add test for multiline syntax error traceback (GH-30695)Russel Webber2022-01-271-7/+41
|
* bpo-40280: Skip subprocess-based tests on wasm32-emscripten (GH-30615)Christian Heimes2022-01-251-1/+3
|
* bpo-46425: fix direct invocation of `test_traceback` (GH-30746)Nikita Sobolev2022-01-221-2/+3
|
* bpo-45615: Add missing test for printing traceback for non-exception. Fix ↵Irit Katriel2022-01-021-0/+16
| | | | traceback.py (GH-30091)
* bpo-37971: fix the position of decorator application (GH-30027)Carl Friedrich Bolz-Tereick2021-12-101-0/+45
| | | | | | | The line numbers of actually calling the decorator functions of functions and classes was wrong (as opposed to loading them, were they have been correct previously too). Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-45607: Make it possible to enrich exception displays via setting their ↵Irit Katriel2021-12-031-0/+69
| | | | __note__ field (GH-29880)
* bpo-45614: Fix traceback display for exceptions with invalid module name ↵Irit Katriel2021-11-271-0/+11
| | | | (GH-29726)
* bpo-45292: [PEP 654] Update traceback display code to work with exception ↵Irit Katriel2021-11-051-1/+514
| | | | groups (GH-29207)
* bpo-45249: Fix caret location when end_offset is set to 0 (GH-28855)Pablo Galindo Salgado2021-10-161-0/+10
|
* bpo-45249: Ensure the traceback module prints correctly syntax errors with ↵Pablo Galindo Salgado2021-09-271-0/+13
| | | | ranges (GH-28575)
* bpo-41031: Match C and Python code formatting of unprintable exceptions and ↵Irit Katriel2021-09-051-3/+29
| | | | exceptions in the __main__ module. (GH-28139)
* bpo-45075: distinguish between frame and FrameSummary in traceback mo… ↵Irit Katriel2021-09-031-5/+5
| | | | (GH-28112)
* bpo-45083: Include the exception class qualname when formatting an exception ↵Irit Katriel2021-09-031-0/+13
| | | | | (GH-28119) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* bpo-31299: make it possible to filter out frames from tracebacks (GH-28067)Irit Katriel2021-08-311-0/+28
|
* bpo-43950: support some multi-line expressions for PEP 657 (GH-27339)Batuhan Taskaya2021-07-251-0/+24
| | | | | | | | | | | | | | | | | | | | | 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-0/+22
|
* bpo-43950: ensure source_line is present when specialising the traceback ↵Batuhan Taskaya2021-07-241-0/+25
| | | | (GH-27313)
* bpo-44569: Decouple frame formatting in traceback.py (GH-27038)Ammar Askar2021-07-161-0/+15
|
* bpo-43950: make BinOp specializations more reliable (GH-27126)Batuhan Taskaya2021-07-151-0/+38
|
* bpo-43950: Specialize tracebacks for subscripts/binary ops (GH-27037)Batuhan Taskaya2021-07-121-2/+80
| | | | 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/+4
| | | | | | As of 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b, lineno is None instead of -1 if there is no line number. Signed-off-by: Filipe Laíns <lains@riseup.net>
* Remove __cleanenv from PEP-657 tests (GH-27060)Ammar Askar2021-07-071-2/+2
|
* bpo-43950: Add option to opt-out of PEP-657 (GH-27023)Ammar Askar2021-07-071-17/+88
| | | | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* bpo-43950: Print columns in tracebacks (PEP 657) (GH-26958)Ammar Askar2021-07-041-21/+155
| | | | | | | | 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-0/+16
| | | | | (GH-24331) …inel defaults
* bpo-33809: add the TracebackException.print() method (GH-24231)Irit Katriel2021-05-221-0/+17
|
* bpo-43146: fix None-handling in single-arg traceback.print_exception(None) ↵Irit Katriel2021-02-231-0/+5
| | | | | (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-0/+18
|
* bpo-42877: add the 'compact' param to TracebackException's __init__ (#24179)Irit Katriel2021-01-151-0/+40
| | | 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-0/+25
|
* bpo-34463: Make python tracebacks identical to C tracebacks for SyntaxErrors ↵Irit Katriel2020-12-221-0/+25
| | | | without a lineno (GH-23427)
* bpo-42482: remove reference to exc_traceback from TracebackException (GH-23531)Irit Katriel2020-12-011-0/+22
|
* bpo-42474: test TracebackException comparison to non-equal instances (GH-23522)Irit Katriel2020-11-271-2/+39
| | | Closes bpo-42474
* bpo-26389: Allow passing an exception object in the traceback module (GH-22610)Zackery Spytz2020-11-051-0/+20
| | | | | | 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-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)Victor Stinner2020-08-111-2/+2
| | | Automerge-Triggered-By: @tiran
* bpo-40275: Use new test.support helper submodules in tests (GH-21317)Hai Shi2020-07-061-1/+2
|
* bpo-40939: Remove the old parser (GH-20768)Pablo Galindo2020-06-111-1/+0
| | | This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
* bpo-40612: Fix SyntaxError edge cases in traceback formatting (GH-20072)Guido van Rossum2020-05-151-8/+26
| | | | | | | | | | | | | 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