-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for fine-grained error location lines in Python tracebacks
See: PEP 657 Python 3.11 makes it easier to identify where on the line a problem occurred. This is achieved with the error location lines. We need to skip such lines when parsing the traceback, otherwise we won't identify the exception name correctly (See: rhbz#2137473). Example: Traceback (most recent call last): File "test.py", line 2, in <module> x['a']['b']['c']['d'] = 1 ~~~~~~~~~~~^^^^^ TypeError: 'NoneType' object is not subscriptable Signed-off-by: Michal Srb <[email protected]>
- Loading branch information
1 parent
7e20e30
commit 8143690
Showing
5 changed files
with
68 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
unreleased | ||
========== | ||
Add support for fine-grained error location lines in Python tracebacks | ||
|
||
0.39 | ||
========== | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
will_python3_raise:3:<module>:ZeroDivisionError: division by zero | ||
|
||
Traceback (most recent call last): | ||
File "/usr/bin/will_python3_raise", line 3, in <module> | ||
0/0 | ||
~^~ | ||
ZeroDivisionError: division by zero | ||
|
||
Local variables in innermost frame: | ||
__name__: '__main__' | ||
__doc__: None | ||
__package__: None | ||
__loader__: <_frozen_importlib_external.SourceFileLoader object at 0x7fd295c62c50> | ||
__spec__: None | ||
__annotations__: {} | ||
__builtins__: <module 'builtins' (built-in)> | ||
__file__: '/usr/bin/will_python3_raise' | ||
__cached__: None |