Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

RPyC client in python 2 cannot make requests to RPyC server running python 3. #327

Closed
DonaldKevin opened this issue May 24, 2019 · 2 comments
Assignees

Comments

@DonaldKevin
Copy link

I was experimenting, and I discovered that a client and a server have to be running the same version of python to talk to each other.

Don't know if it is a huge problem, or even something you want to support.

rpyc-4.0.2
ubuntu 18.04

first case python3 server, python2 client

Traceback (most recent call last):
  File "./matlabClient.py", line 17, in <module>
    r = c.root.performMatlab("gcd", *l)
  File "/home/lafayette/.local/lib/python2.7/site-packages/rpyc/core/netref.py", line 199, in __call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
  File "/home/lafayette/.local/lib/python2.7/site-packages/rpyc/core/netref.py", line 75, in syncreq
    return conn.sync_request(handler, proxy, *args)
  File "/home/lafayette/.local/lib/python2.7/site-packages/rpyc/core/protocol.py", line 471, in sync_request
    return self.async_request(handler, *args, timeout=timeout).value
  File "/home/lafayette/.local/lib/python2.7/site-packages/rpyc/core/async_.py", line 97, in value
    raise self._obj
rpyc.core.vinegar/builtins.TypeError: must be str, not bytes

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "/home/lafayette/.local/lib/python3.6/site-packages/rpyc/core/protocol.py", line 329, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
  File "/home/lafayette/.local/lib/python3.6/site-packages/rpyc/core/protocol.py", line 590, in _handle_call
    return obj(*args, **dict(kwargs))
  File "matlabService.py", line 162, in exposed_performMatlab
    return performMatlab(theMatlabFunc, *args, **kwargs)
  File "matlabService.py", line 121, in performMatlab
    " " + repr(args) + " " + repr(kwargs))
TypeError: must be str, not bytes

second case python2 server, python 3 client

Traceback (most recent call last):
  File "matlabClient.py", line 17, in <module>
    r = c.root.performMatlab("gcd", *l)
TypeError: 'b'instancemethod'' object is not callable
@comrumino
Copy link
Collaborator

comrumino commented May 30, 2019

Since Python 2.7 will not be maintained beyond 2020, I'd rather not endorse the use of a soon-to-be no longer maintained version. Adding 2-3 support would violate the projects transparent aim as well. So this is not something I intend to add support for.

Rather than marking this won't fix, I think the aim here would be to improve the usability---error/warning logging should be done for unsupported client-server combinations (both Python version and RPyC version).

@comrumino
Copy link
Collaborator

Closing this as it now falls under #332

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants