-
Notifications
You must be signed in to change notification settings - Fork 245
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
IPython pretty print issue #280
Comments
FYI, this issue was due to ipython using a mechanism similar to: d = {...}
for cls in obj.__class__.__mro__:
if cls in d:
... This effectively requires the ability to do One point to note: I couldn't reproduce your exact error, in my case your example errored with: |
Client python 3.6, Server python is 3.7 Getting a similar issue in the IPython environment when import rpyc
c = rpyc.connect("sergey-nuc.local", 9090)
c.root.run(some="thing", than="returns", "dict") Getting smth like this:
|
I had a similar issue (I'm writing this here, but in case this is not related, maybe should be moved to a standalone issue). In my case, IPython checks at some point I ended up adding this workaround until a fix will be introduced: import types
from rpyc.core.protocol import Connection
# Fix for calling bool(ClassType)
def _handle_getattr(self, obj, name): # request handler
out = self._access_attr(obj, name, (), "_rpyc_getattr", "allow_getattr", getattr)
if name == '__len__' and type(obj) == type and isinstance(out, types.WrapperDescriptorType):
return lambda: True
return out
Connection._handle_getattr = _handle_getattr |
Thanks for reporting the issue and tracking the issue here is okay with me---it seems likely that it is in the same class of bugs. I'll take a look |
Thanks! I use rpyc to manipulate another application. Our client app is an IPython interpreter. python version: python3.7 (using docker image python:3.7.6-stretch) Was something added that was expected to cause a slowdown? |
Off hand, there isn't anything that I could think of that would really change the performance that much. I did take a quick glance at CHANGELOG.rst and all the changes have been related to bugs. Could you provide empirical data or a way to reproduce the change in overhead? It would help narrow down which parts of the API are invoked more heavily for your use case. I'd be glad to look into it since improving overhead is one the upcoming mountains to move. If I were to blindly guess what the culprit could be:
Ironically, there were supposed to be minor performance improvements between those versions. Anyway, I'd greatly appreciate any help in measuring the overhead with |
Sure, attached is a standalone reproducible code:
With: |
Some commit times to confirm.
After pushing an improvement
I'll try to take a look at the actual pretty print issue soon. |
@talsaiag I failed to reproduce the issue using 4.1.4 rpyc and 7.12.0 IPython. Could you provide a minimal example that causes an issue (i.e. I will try to reproduce on my end as well. Steps to reproduce allow me to confirm, diagnose, and fix in a more timely way. |
I haven't had much time to work on this since I managed to simply work around the issue by detecting if the object to be pretty printed is from the remote endpoint, and if so I called the remote endpoint's |
Hello,
First of all, thank you for the amazing library!
I'm having some trouble displaying some remote objects in IPython/Jupyter Notebooks. (Regular print works)
I've narrowed it down to this example:
Stack trace:
I haven't been able to find any references to this error on the internet.
Environment
Server
Client
Minimal example
I don't have access to the server's python module unfortunately
The text was updated successfully, but these errors were encountered: