Pyro4 and IronPython problem

Tom Miller <[email protected]>
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>
Hi

I've had Pyro4 running in a automated software test environment for a 
year or so, kicking off processes between Windows and Linux machines 
very successfully. Last week I realized that I must switch from CPython 
to IronPython to get better responsiveness from python threads.

I'm using Pyro4 4.16 and IronPython 2.7.3. My previously working Pyro4 
remote command execution code fails under IronPython. See example code 
below, and the resulting stack trace below that.

> from systest.Constants import WEBHOST_PYRO_ADDRESS
> import Pyro4.utils.flame
>
> code = '''
> import subprocess
>
> def runProcesses(task_spec):
>
>     try:
>         subprocess.check_call(task_spec)
>     except subprocess.CalledProcessError, e:
>         return e.returncode
>     else:
>         return 0
> '''
>
> flame = Pyro4.utils.flame.connect(WEBHOST_PYRO_ADDRESS)
>
> tasks = [
>          ['schtasks', '/run', '/tn', 'Daily.job'],
>          ]
>
> flame.sendmodule("systest.Schtasks", code)  ###### THIS LINE FAILS & 
> CREATES STACK TRACE BELOW
>
> for task in tasks:
>     result = flame.module("systest.Schtasks").runProcesses(task)
>
>     print("\nresult from uploaded module: %s" % result)

> Traceback (most recent call last):
>
>   File 
> "C:\bin\eclipse\plugins\org.python.pydev_2.7.1.2012100913\pysrc\pydevd.py", 
> line 1397, in <module>
>
>   File 
> "C:\bin\eclipse\plugins\org.python.pydev_2.7.1.2012100913\pysrc\pydevd.py", 
> line 1090, in run
>
>   File "C:\Users\tmiller\workspace\systest\SchtasksClient.py", line 
> 29, in <module>
>
>   File "C:\IronPython27\lib\site-packages\Pyro4\core.py", line 149, in 
> __call__
>
>   File "C:\IronPython27\lib\site-packages\Pyro4\core.py", line 294, in 
> _pyroInvoke
>
> TypeError: module.__init__() argument 1 must be string, not unicode

I've read about the Pyro4 workaround for IronPython. Is there something 
more I need to know to get this to work?

Thanks
Tom<skype:millerassoc?chat>



------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.