[Zope-Checkins] CVS: Zope/lib/python - xmlrpclib.py:1.6.132.2

Toby Dickenson tdickenson@geminidataloggers.com
Fri, 31 May 2002 07:55:07 -0400


Update of /cvs-repository/Zope/lib/python
In directory cvs.zope.org:/tmp/cvs-serv19592

Modified Files:
      Tag: toby-xmlrpclib099-branch
	xmlrpclib.py 
Log Message:
added marshalling of None, and inhibited marshalling of class instances (for now, anyway). I didnt apply the fix from rev 1.5, because 0.9.9 already has some different https support. So far https support is untested; I will do this next week.

=== Zope/lib/python/xmlrpclib.py 1.6.132.1 => 1.6.132.2 ===
         dispatch[UnicodeType] = dump_unicode
 
+    # Zope-specific extension; xmlrpc doesnt have an equivalent of
+    # Python's None. the standard xmlrpclib raises an exception,
+    # but marshalling it as a zero is more convenient.
+    def dump_none(self, value):
+        self.write("<value><int>0</int></value>\n")
+    dispatch[IntType] = dump_int
+
     def container(self, value):
         if value:
             i = id(value)
@@ -408,7 +415,10 @@
         else:
             # store instance attributes as a struct (really?)
             self.dump_struct(value.__dict__)
-    dispatch[InstanceType] = dump_instance
+    # Zope-specific change. dont do this
+    # http://collector.zope.org/Zope/410
+    #
+    # dispatch[InstanceType] = dump_instance
 
 class Unmarshaller: