After some tries, I found a way to make it work, but it's a bit ugly:
Here is the example:
exposed_translate_good works, while exposed_translate_bad does not:
from lib import fileConverter
class MyService(rpyc.Service):
def exposed_translate_bad(self, ...):
fileConverter(...) # opens the converter utility in Popen
def exposed_translate_good(self, ...):
process = subprocess.Popen(["c:\\python31\\python.exe",
'my_script.py', ...], stdout = subprocess.PIPE, stderr = subprocess.PIPE)
process.communicate()
# my_script.py:
# from lib import fileConverter
# fileConverter(...) # opens the converter utility in Popen
On Sunday, December 30, 2012 1:20:40 PM UTC+2, Tomer Filiba wrote:
>
> You mean the rpyc service spawns a child process and that process fails to
> start correctly? And when you run this process yourself it works? Did you
> check if this child process can run without a TTY? Perhaps that's the
> problem
> On Dec 30, 2012 12:15 PM, "tuzik tuzikovich" <[email protected]<javascript:>>
> wrote:
>
>> Hello
>> I wrote a RPyC service, which runs some third-party file conversion
>> utility via Popen. This utility must acquire a license from a license
>> server, when it starts.
>> For some reason it fails to do so. The same code without RPyC service
>> wrapper runs perfectly. Does RPyC block in some way the children processes?
>> Any ideas?
>> Thank you,
>> Yuri
>>
>