| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
__getattr__ (GH-113359) (#114118)
|
|
|
|
| |
(#111373)
|
|
|
|
|
|
|
| |
(#109197) (#109283)
gh-109179: Fix traceback display for SyntaxErrors with notes (#109197)
(cherry picked from commit ecd21a629a2a30bcae89902f7cad5670e9441e2c)
|
|
|
|
|
|
| |
parentheses (GH-108959) (#109148)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
(#98850)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
| |
(cherry picked from commit 264b3ddfd561d97204ffb30be6a7d1fb0555e560)
|
|
|
|
|
|
|
|
|
| |
(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-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-31294)
|
| |
|
| |
|
| |
|
|
|
|
| |
traceback.py (GH-30091)
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
__note__ field (GH-29880)
|
|
|
|
| |
(GH-29726)
|
|
|
|
| |
groups (GH-29207)
|
| |
|
|
|
|
| |
ranges (GH-28575)
|
|
|
|
| |
exceptions in the __main__ module. (GH-28139)
|
|
|
|
| |
(GH-28112)
|
|
|
|
|
| |
(GH-28119)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
(GH-27313)
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
|
|
|
|
|
|
| |
As of 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b, lineno is None instead
of -1 if there is no line number.
Signed-off-by: Filipe Laíns <lains@riseup.net>
|
| |
|
|
|
|
|
| |
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
(GH-24331)
…inel defaults
|
| |
|
|
|
|
|
| |
(GH-24629)
(The previous commit fixed print_exception(None, None, None).)
|
| |
|
|
|
| |
Use it to reduce the time and memory taken up by several of traceback's module-level functions.
|
| |
|
|
|
|
| |
without a lineno (GH-23427)
|
| |
|
|
|
| |
Closes bpo-42474
|
|
|
|
|
|
| |
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>
|
|
|
| |
Automerge-Triggered-By: @tiran
|
| |
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|