This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: xmlrpclib: Optional 'nil' support
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, jpa-, loewis, nnorwitz
Priority: normal Keywords: patch

Created on 2002-10-24 19:33 by akuchling, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
nil-patch akuchling, 2002-10-24 19:33 Adds support for <nil/> to xmlrpclib.py
nil-patch.2 akuchling, 2002-10-29 16:45 Revised version of the patch
Messages (7)
msg41435 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2002-10-24 19:33
This patch doesn't include documentation or test suite 
updates yet, and only touches the <

The <nil/> extension is defined at 
http://ontosys.com/xml-rpc/extensions.html.

Outstanding questions:

* To generate <nil/>, an option must be explicitly 
supplied to dumps().  <nil/> is always accepted, 
and it can't be turned off.  Is this OK?  

* Similarly, allow_none is on or off for a ServerProxy; 
you can't turn it on for just one method.  (Seems a 
reasonable limitation...)

* Should the parameter to enable it  be named 
allow_none (Python term) or allow_nil (XML-RPC 
term)?

* When allow_none is false and a None is 
encountered, 
this patch raises a ValueError.  Is that the right 
exception, or should it use xmlrpclib.Error?  Can 
anyone suggest a better message for the exception?

* The FastMarshaller accelerator would also need to 
be updated.

* Are we ever likely to change the default for 
allow_none to True?  If so, how should we arrange 
things so we can warn people?
msg41436 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-10-24 19:50
Logged In: YES 
user_id=21627

On the exception: Currently, you get

TypeError: cannot marshal <type 'NoneType'> objects

and TypeError seems to be the right thing. The message might
read

cannot marshal None unless allow_none is enabled

On allowing None by default: I'd assume that you would want
to disable None only for "strictly-conforming" operation, so
I'd expect to see an option strict (which then defaults to
False). I don't know in what other ways we'd reasonably
deviate from the spec. 

If that ever happens, I don't think a transitional warning
is needed: existing applications continue to work. In
general, in cases that produce an exception now, we don't
need a transition procedure.
msg41437 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2002-10-29 16:44
Logged In: YES 
user_id=11375

Updated version of the patch: raises TypeError instead of ValueError, and uses Martin's suggested wording; thanks!

Now it's up to /F to accept, decline, or request revisions to this patch.

msg41438 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-04-19 08:01
Logged In: YES 
user_id=21627

Since /F seems unresponsive, I'll accept the patch, on the
provision that it is integrated before Python 2.3b1 (or
after Python 2.3 is released), and that a documentation
change is also committed.
msg41439 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2003-04-20 19:06
Logged In: YES 
user_id=11375

Should I leave the name of the 'allow_none' parameter alone,
or should I change it to 'strict' and default it to True?
msg41440 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-04-26 01:20
Logged In: YES 
user_id=33168

This was checked in.  Is there anything left to do or should
this patch be closed?
msg41441 - (view) Author: jpa (jpa-) Date: 2005-07-09 14:29
Logged In: YES 
user_id=1197626

Should it be possible to return 'None' from function? I'm having 
problem with this, and I think the "cannot marshal" error is 
coming from the server, not client. However, 
SimpleXMLRPCServer doesn't recognize allow_none as an 
argument? 
History
Date User Action Args
2022-04-10 16:05:47adminsetgithub: 37363
2002-10-24 19:33:11akuchlingcreate