Related link: http://pyro.sourceforge.net/

I ran into a situation recently where I needed to pass “None” as a value to some code which runs under the SimpleXMLRPCServer in the Python standard library. I immediately got a Fault something like this:

<Fault 1: ‘exceptions.TypeError:cannot marshal None unless allow_none is enabled’>

I tried turning on allow_none by putting something like this in my XMLRPC client:

xmlrpclib.ServerProxy(”http://localhost:8000″, allow_none=1)

I never got this quite working, but by googling around, it seems that the XMLRPC spec doesn’t have support for a None datatype. I anticipate that I won’t need “None” much, but when you need it, you need it. I figured I could kludge something, but why?

I had heard people speak highly about Pyro for a while on comp.lang.python, but I had been hesitant to try it. My hesitation came from satisfaction with XMLRPC and not wanting to have to include an additional package in my code when I went to deploy it. One point of hesitation had just been removed. XMLRPC just wasn’t working for me. And having an extra package turned out to not be as big of a problem for me as I initially thought it would be.

I decided to give it a spin. It was really easy to just drop in a Pyro server where my SimpleXMLRPCServer had been. And it was another easy matter to replace the XMLRPC client code with Pyro client code. And “None” worked without a problem. I’ve been running it for a few months now and have had no problems with it.

I can enthusiastically recommend Pyro to anyone needing Python->Python interprocess communication.