Commit a6a8b81b authored by Amos Latteier's avatar Amos Latteier

Improved response marshalling. Now None is returned as a Boolean Fals, since...

Improved response marshalling. Now None is returned as a Boolean Fals, since XML-RPC doesn't handle None. Also a Fault is returned if the response cannot be marshalled.
parent b8afc1e8
......@@ -173,7 +173,13 @@ class Response:
# Marshall our body as an XML-RPC response. Strings will be sent
# strings, integers as integers, etc. We do *not* convert
# everything to a string first.
body = xmlrpclib.dumps((body,), methodresponse=1)
if body is None:
body=xmlrpclib.False # Argh, XML-RPC doesn't handle null
try:
body = xmlrpclib.dumps((body,), methodresponse=1)
except:
self.exception()
return
# Set our body to the XML-RPC message, and fix our MIME type.
self._real.setBody(body)
self._real.setHeader('content-type', 'text/xml')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment