You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "<string>", line 3, in __init__
File "<stdin>", line 5, in __post_init__
File "<stdin>", line 7, in bar
ValueError: Not valid
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
File "/home/ubuntu/project/.venv/lib/python3.10/site-packages/rich/console.py", line 1862, in print_exception
traceback = Traceback(
File "/home/ubuntu/project/.venv/lib/python3.10/site-packages/rich/traceback.py", line 264, in __init__
trace = self.extract(
File "home/ubuntu/project/..venv/lib/python3.10/site-packages/rich/traceback.py", line 449, in extract
locals={
File "/home/ubuntu/project/.venv/lib/python3.10/site-packages/rich/traceback.py", line 450, in <dictcomp>
key: pretty.traverse(
File "/home/ubuntu/project/.venv/lib/python3.10/site-packages/rich/pretty.py", line 853, in traverse
node = _traverse(_object, root=True)
File "/home/ubuntu/project/.venv/lib/python3.10/site-packages/rich/pretty.py", line 767, in _traverse
child_node = _traverse(getattr(obj, field.name), depth=depth + 1)
AttributeError: 'A' object has no attribute 'foo'
This might be a corner case, but it would be great if rich could support this because in this case the class doesn't have the foo attribute when the exception happens
Platform
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
ubuntu 22.04
The text was updated successfully, but these errors were encountered:
Describe the bug
Rich traceback can't handle dataclass that fails on
__post_init__
and it's not initializedProvide a minimal code example that demonstrates the issue if you can. If the issue is visual in nature, consider posting a screenshot.
This will give the following traceback:
This might be a corner case, but it would be great if rich could support this because in this case the class doesn't have the
foo
attribute when the exception happensPlatform
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
ubuntu 22.04
The text was updated successfully, but these errors were encountered: