If we are running a script on another machine, having to do
stdout, stderr = proc.communicate()
print stdout.split()
is not very helpful.
Ideally, what the user experiences on the remote machine, should
be seen on the local machine.
For some reason,
proc = conn.modules.subprocess.Popen("ls", stdout = sys.stdout, stderr = sys.stdin)
causes a terrible exception.
I don't understand this
>>> proc=conn.modules.subprocess.Popen("dir",stdout=sys.stdout,stderr=sys.stderr)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\Lib\site-packages\rpyc\core\netref.py", line 196, in __call__
return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
File "C:\Python27\Lib\site-packages\rpyc\core\netref.py", line 71, in syncreq
return conn.sync_request(handler, oid, *args)
File "C:\Python27\Lib\site-packages\rpyc\core\protocol.py", line 441, in sync_request
raise obj
AttributeError: 'file' object has no attribute '__eq__'
========= Remote Traceback (2) =========
Traceback (most recent call last):
File "C:\Python27\Lib\site-packages\rpyc\core\protocol.py", line 305, in _dispatch_request
res = self._HANDLERS[handler](self, *args)
File "C:\Python27\Lib\site-packages\rpyc\core\protocol.py", line 535, in _handle_call
return self._local_objects[oid](*args, **dict(kwargs))
File "C:\Python27\lib\subprocess.py", line 701, in __init__
errread, errwrite), to_close = self._get_handles(stdin, stdout, stderr)
File "C:\Python27\lib\subprocess.py", line 842, in _get_handles
elif stdout == PIPE:
File "C:\Python27\Lib\site-packages\rpyc\core\netref.py", line 210, in method
return syncreq(_self, consts.HANDLE_CALLATTR, name, args, kwargs)
File "C:\Python27\Lib\site-packages\rpyc\core\netref.py", line 71, in syncreq
return conn.sync_request(handler, oid, *args)
File "C:\Python27\Lib\site-packages\rpyc\core\protocol.py", line 441, in sync_request
raise obj
AttributeError: 'file' object has no attribute '__eq__'
========= Remote Traceback (1) =========
Traceback (most recent call last):
File "C:\Python27\Lib\site-packages\rpyc\core\protocol.py", line 305, in _dispatch_request
res = self._HANDLERS[handler](self, *args)
File "C:\Python27\Lib\site-packages\rpyc\core\protocol.py", line 547, in _handle_callattr
return self._handle_getattr(oid, name)(*args, **dict(kwargs))
File "C:\Python27\Lib\site-packages\rpyc\core\protocol.py", line 541, in _handle_getattr
return self._access_attr(oid, name, (), "_rpyc_getattr", "allow_getattr", getattr)
File "C:\Python27\Lib\site-packages\rpyc\core\protocol.py", line 507, in _access_attr
return accessor(obj, name, *args)
AttributeError: 'file' object has no attribute '__eq__'