pushyrpc / pushy

Easy-as RPC. Zero-server RPC for Python and Java.
http://github.com/pushyrpc/pushy
45 stars 18 forks source link

pushy connection fails against remote python 2.4.3 #47

Closed bradharmon closed 11 years ago

bradharmon commented 11 years ago

Somewhere between pushy 0.5.1 and 0.5.3, creating a pushy connection fails with a local python version of 2.6.6 and a remote python version of 2.4.3. Downgrading to pushy 0.5.1 solves the issue.

conn = pushy.connect('ssh:random_box', username='root', password='blah')

  File "/usr/lib/python2.6/site-packages/pushy/client.py", line 580, in connect
    return PushyClient(target, **kwargs)
  File "/usr/lib/python2.6/site-packages/pushy/client.py", line 386, in __init__
    self.modules = AutoImporter(self)
  File "/usr/lib/python2.6/site-packages/pushy/client.py", line 236, in __init__
    remote_compile = self.__client.eval("compile")
  File "/usr/lib/python2.6/site-packages/pushy/client.py", line 475, in eval
    return self.remote.eval(code, globals, locals)
  File "/usr/lib/python2.6/site-packages/pushy/protocol/connection.py", line 54, in eval
    return self.send_request(MessageType.evaluate, args)
  File "/usr/lib/python2.6/site-packages/pushy/protocol/baseconnection.py", line 321, in send_request
    m = self.__waitForResponse(handler)
  File "/usr/lib/python2.6/site-packages/pushy/protocol/baseconnection.py", line 426, in __waitForResponse
    m = self.__recv()
  File "/usr/lib/python2.6/site-packages/pushy/protocol/baseconnection.py", line 607, in __recv
    m = self.__istream.receive_message()
  File "/usr/lib/python2.6/site-packages/pushy/protocol/baseconnection.py", line 104, in receive_message
    return Message.unpack(self.__file)
  File "/usr/lib/python2.6/site-packages/pushy/protocol/message.py", line 96, in unpack
    header = read(file, Message.PACKING_SIZE)
  File "/usr/lib/python2.6/site-packages/pushy/protocol/message.py", line 60, in read
    raise IOError, "End of file"
pushy.client.ClientInitException: 
axw commented 11 years ago

Thanks for reporting the problem. I'm away for work at the moment, will hopefully get to this in a couple of days.

axw commented 11 years ago

Should be fixed now. Please reopen if the issue persists.

gregnwosu commented 10 years ago

dont think this is fixed im seeing the same issue running python2.6 against unix python2.4 with your patch applied

axw commented 10 years ago

@gregnwosu I can successfully connect a Python 2.6 to 2.4 interpreter. If you can provide a set of steps to reproduce the issue, someone may be able to help (I can't guarantee it'll be me, though).

gregnwosu commented 10 years ago

I've done a little more investigation, it seems that these errors occur when connecting to python 2.3

Ive also observed strange behaviour when connecting from inside unit tests , especially using nose which tends to capture output streams

axw commented 10 years ago

@gregnwosu Ah, that makes sense then; Pushy does not support 2.3 (or earlier). I don't recall the reason why. If it can be made to work with minimal changes, I'd probably accept a pull request.