[Twisted-web] XML-RPC and None

Tommi Virtanen tv at twistedmatrix.com
Wed Jun 15 14:59:42 MDT 2005


Matt Feifarek wrote:
> We'd like to pass None through the rpc connection on occasion. There's
> a flag in the standard lib to allow this to serialize ( send
> allow_none=True to the xmlrpclib.Server() )
> 
> We're getting this error from the twisted resource when we try to
> serialize 'None':
> 
> Fault: <Fault 8002: "can't serialize output">
> 
> I know that the twisted resources uses the stock xmlrpclib, but how
> can we tell it to allow None to serialize the twisted way?

With the current twisted.web.xmlrpc, you can't.
(You'd need to patch that to optionally give an allow_none
flag to everything using dumps/loads.)

Why do people want to break the perfectly nice standard, anyway?
Return a tuple (False, ) for None and (True, stuff) for stuff,
or something..



More information about the Twisted-web mailing list