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
Edit this with a clear and concise description of what the bug.
Provide a minimal code example that demonstrates the issue if you can. If the issue is visual in nature, consider posting a screenshot.
A weakref.proxy object can be used as the wrapped object when the object is not GC-ed. Then the object is finalized, the accessing the attributes of the weakref.proxy object will raise RefereenceError.
The weakref.proxy type has a proper __repr__ to handle the dead reference but rich traverse tries to inspec the proxy object and that will raise errors when the referenced object is gone.
In [1]: importweakrefIn [2]: importrichIn [3]: classFoo:
...: pass
...:
In [4]: rich.print(weakref.ref(Foo()))
<weakrefat0x7f98d28b50d0; dead>In [5]: rich.print(weakref.proxy(Foo()))
ReferenceError: weakly-referencedobjectnolongerexistsIn [6]: repr(weakref.ref(Foo()))
Out[6]: '<weakref at 0x7f98d0a80540; dead>'In [7]: repr(weakref.proxy(Foo()))
Out[7]: '<weakproxy at 0x7f98d0a12070 to NoneType at 0x7f98d6516120>'
Platform
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
I may ask you to copy and paste the output of the following commands. It may save some time if you do it now.
If you're using Rich in a terminal:
python -m rich.diagnose
pip freeze | grep rich
If you're using Rich in a Jupyter Notebook, run the following snippet in a cell
and paste the output in your bug report.
fromrich.diagnoseimportreportreport()
The text was updated successfully, but these errors were encountered:
Describe the bug
Edit this with a clear and concise description of what the bug.
Provide a minimal code example that demonstrates the issue if you can. If the issue is visual in nature, consider posting a screenshot.
A
weakref.proxy
object can be used as the wrapped object when the object is not GC-ed. Then the object is finalized, the accessing the attributes of theweakref.proxy
object will raiseRefereenceError
.The
weakref.proxy
type has a proper__repr__
to handle the dead reference butrich
traverse tries to inspec theproxy
object and that will raise errors when the referenced object is gone.Platform
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
I may ask you to copy and paste the output of the following commands. It may save some time if you do it now.
If you're using Rich in a terminal:
If you're using Rich in a Jupyter Notebook, run the following snippet in a cell
and paste the output in your bug report.
The text was updated successfully, but these errors were encountered: