I get this error message if i use the code you mentioned:

>>> proc = c.modules.subprocess.Popen(["ls"], stdin = subprocess.PIPE, 
stdout =
subprocess.PIPE, stderr = subprocess.PIPE)
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
WindowsError: [Error 2] The system cannot find the file specified: None

========= Remote Traceback (1) =========
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\rpyc\core\protocol.py", line 305, in 
_disp
atch_request
    res = self._HANDLERS[handler](self, *args)
  File "C:\Python27\lib\site-packages\rpyc\core\protocol.py", line 535, in 
_hand
le_call
    return self._local_objects[oid](*args, **dict(kwargs))
  File "C:\Python27\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified


On Saturday, 28 January 2012 17:17:50 UTC+5:30, Tomer Filiba wrote:
>
> please use the mailing list to ask questions... 
>
> anyway, you want to run a process on a remote machine and get back its 
> stdout/err?
> just use the subprocess module, like so:
>
> c = rpyc.classic.connect("my-other-machine")
> proc = c.modules.subprocess.Popen(["/the/program", "--and", "some", 
> "arguments"], stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = 
> subprocess.PIPE)
> stdout, stderr = proc.communicate()
>
> you can then call proc.terminate() or kill() to terminate the program 
> after a certain timeout.
> if it's on a posix machine, you can use select(), otherwise, start a 
> thread (see threading.Timer in the stdlib).
>
> -----------------------------------------------------------------
>     
> *Tomer Filiba* 
> tomerfiliba.com     <http://www.facebook.com/tomerfiliba>     
> <http://il.linkedin.com/in/tomerfiliba> 
>
>
>
> On Sat, Jan 28, 2012 at 13:31, Ido <[email protected] <javascript:>> 
> wrote:
>
>> Hi,
>>
>> I'm trying to use rpyc to run commands on remote servers.
>> I am interested in sending back STDOUT/ERR responses to the client, and 
>> having the option of terminating the running command after a predefined 
>> timeout. I care less if its run async or not.
>>
>> My problem is that Popen has blocking reads, and will also need to be 
>> terminated manually ? (It seems that if I use rpyc.timeout, although the 
>> client times out, the popen/command continues to run on the server).
>>
>> I'm not much of a python programmer, however this is my only need.
>> I also googled around, and tried hacking a fix myself, but was 
>> unsuccessful.
>>
>> Can you please tell me what needs to be done ? (or maybe hack up a 
>> solution yourself for me :)
>>
>> Toda.
>>
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"rpyc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to