-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] rich crashes ipython when printing a traceback after due to StopIteration
error
#2821
Comments
I think this is the same underlying issue as #2800 |
exact same thing is happening to me, what is the suggested fix for this? this is breaking our prod build and we need an urgent fix, please let us know or we'll have to move off rich, thanks im using django-rich and here's a stack trace
|
I hope we solved your problem. If you like using Rich, you might also enjoy Textual |
thanks, confirming it works again on latest version!! |
Describe the bug
Using
%load_ext rich
in python, printing a traceback will sometimes cause ipython to crash with an errorRuntimeError: generator raised StopIteration
It's possible this is related to #2781, and maybe others with strange crashes/hanging?
Example code
(sorry i couldn't find one without pydantic, this was just the quickest/smallest thing related to what I was really doing)
saved into
testrich.py
then in ipython
(mapping) staniewi:data$ ipython Python 3.10.9 | packaged by conda-forge | (main, Feb 2 2023, 20:26:08) [Clang 14.0.6 ] Type 'copyright', 'credits' or 'license' for more information IPython 8.4.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: import testrich In [2]: testrich.Dummy() --------------------------------------------------------------------------- ValueError Traceback (most recent call last) Input In [2], in <cell line: 1>() ----> 1 testrich.Dummy() File ~/repos/sweets/testrich.py:7, in Dummy.__init__(self, **data) 5 def __init__(self, **data): 6 super().__init__(**data) ----> 7 self.new_attribute = "this should error due to pydantic" File ~/miniconda3/envs/mapping/lib/python3.10/site-packages/pydantic/main.py:358, in pydantic.main.BaseModel.__setattr__() ValueError: "Dummy" object has no field "new_attribute"
that's whats supposed to be printed. Here's with rich:
Platform
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
Mac arm M1
The text was updated successfully, but these errors were encountered: