[Zope3-checkins] SVN: Zope3/trunk/src/zope/publisher/xmlrpc.py fixed bug #484, that would brake XML-RPC

Tarek Ziadé tziade at nuxeo.com
Fri Nov 4 15:19:35 EST 2005


Log message for revision 39893:
  fixed bug #484, that would brake XML-RPC

Changed:
  U   Zope3/trunk/src/zope/publisher/xmlrpc.py

-=-
Modified: Zope3/trunk/src/zope/publisher/xmlrpc.py
===================================================================
--- Zope3/trunk/src/zope/publisher/xmlrpc.py	2005-11-04 17:24:49 UTC (rev 39892)
+++ Zope3/trunk/src/zope/publisher/xmlrpc.py	2005-11-04 20:19:34 UTC (rev 39893)
@@ -40,9 +40,14 @@
 
     def processInputs(self):
         'See IPublisherRequest'
+        # Parse the request XML structure
 
-        # Parse the request XML structure
-        self._args, function = xmlrpclib.loads(self._body_instream.read())
+        # XXX using readlines() instead of lines()
+        # as twisted's BufferedStream sends back
+        # an empty stream here for read() (bug)
+        lines = ''.join(self._body_instream.readlines())
+        self._args, function = xmlrpclib.loads(lines)
+
         # Translate '.' to '/' in function to represent object traversal.
         function = function.split('.')
 
@@ -201,7 +206,7 @@
       >>> from zope.security.proxy import Proxy
       >>> proxied_sample['foo']
       (1, ['x', 'y', 1.2])
-      
+
       >>> type(proxied_sample['foo']) is Proxy
       True
       >>> type(proxied_sample['foo'][1]) is Proxy
@@ -226,7 +231,7 @@
       >>> from zope.security.checker import NamesChecker, defineChecker
       >>> defineChecker(xmlrpclib.Fault,
       ...               NamesChecker(['faultCode', 'faultString']))
-    
+
       >>> fault = xmlrpclib.Fault(1, 'waaa')
       >>> proxied_fault = ProxyFactory(fault)
       >>> stripped_fault = premarshal(proxied_fault)



More information about the Zope3-Checkins mailing list