[New-bugs-announce] [issue10425] xmlrpclib support for None isn't compliant with XMLRPC

Adam Bielański report at bugs.python.org
Mon Nov 15 13:27:17 CET 2010

New submission from Adam Bielański <abgans at gmail.com>:

XMLRPC standard doesn't support None/nil/null values. Element `<nil/>` was added as an extension to original protocol.

Currently sending None object through xmlrpclib produces `<value><nil/></value>` string. This causes parsing errors in more sophisticated XMLRPC parsers (like org.apache.xmlrpc for Java) which require `<nil/>` element to be declared in namespace for extensions: xmlns:ex='http://ws.apache.org/xmlrpc/namespaces/extensions'

Attached patch makes xmlrpclib use that namespace for sending None values both in method calls and responses, so None value might be passed both ways. It isn't bound to use fixed prefix for extensions namespace and it also parses XML produced by original xmlrpclib (without any namespace at all), so it is backward compatible.

It does its job communicating with org.apache.xmlrpc library now, using default parser on the Python side which is an improvement to original version, so I'd like to see it included in the next Python 2.x release, if possible.

components: Library (Lib), XML
files: xmlrpclib.diff
keywords: patch
messages: 121224
nosy: Adam.Bielański
priority: normal
severity: normal
status: open
title: xmlrpclib support for None isn't compliant with XMLRPC
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file19612/xmlrpclib.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list