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
I want to use RPyC to access properties of a class from the remote host, but when I try to get it work only the getter is working correctly and the setter not. Here the details:
The expected result is that I am able to set the property x of the remote object MyService.
However, I get a different result. This is the output of the "Client.py":
x: 10 type: <class 'int'>
['ALIASES', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__slots__', '__str__', '__subclasshook__', '__weakref__', '_connect', '_protocol', '_rpyc_delattr', '_rpyc_setattr', '_x', '_y', 'exposed_get_service_aliases', 'exposed_get_service_name', 'get_service_aliases', 'get_service_name', 'on_connect', 'on_disconnect', 'x', 'y']
Traceback (most recent call last):
File "<path>\Client.py", line 13, in <module>
main()
File "<path>\Client.py", line 9, in main
c.root.x = 42
File "<path>\venv\lib\site-packages\rpyc\core\netref.py", line 165, in __setattr__
syncreq(self, consts.HANDLE_SETATTR, name, value)
File "<path>\venv\lib\site-packages\rpyc\core\netref.py", line 63, in syncreq
return conn.sync_request(handler, proxy, *args)
File "<path>\venv\lib\site-packages\rpyc\core\protocol.py", line 490, in sync_request
return _async_res.value
File "<path>\venv\lib\site-packages\rpyc\core\async_.py", line 108, in value
raise self._obj
_get_exception_class.<locals>.Derived: access denied
========= Remote Traceback (1) =========
Traceback (most recent call last):
File "<path>\venv\lib\site-packages\rpyc\core\protocol.py", line 324, in _dispatch_request
res = self._HANDLERS[handler](self, *args)
File "<path>\venv\lib\site-packages\rpyc\core\protocol.py", line 631, in _handle_setattr
return self._access_attr(obj, name, (value,), "_rpyc_setattr", "allow_setattr", setattr)
File "<path>\venv\lib\site-packages\rpyc\core\protocol.py", line 553, in _access_attr
return accessor(obj, name, *args)
File "<path>\venv\lib\site-packages\rpyc\core\service.py", line 75, in _rpyc_setattr
raise AttributeError("access denied")
AttributeError: access denied
I am using a virtual environment with the following pyvenv.cfg:
Maybe as an additional comment.
I don't want to use the magic methods to set the value.
It would be nice to have it work out of the box like it should work.
Hi,
I want to use RPyC to access properties of a class from the remote host, but when I try to get it work only the getter is working correctly and the setter not. Here the details:
Server.py
Client.py
The expected result is that I am able to set the property x of the remote object MyService.
However, I get a different result. This is the output of the "Client.py":
I am using a virtual environment with the following pyvenv.cfg:
RPyC version: 5.2.1
Python Version: 3.10
Operatin System: Windows 10
To reproduce the error run the "Server.py" and then the "Client.py".
The documentation Link and Link didn't helped me.
I would appreciate you, when you are able to help.
The text was updated successfully, but these errors were encountered: