On Mon, 2009-05-25 at 17:08 +0200, Michael Haubenwallner wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Christian Theune wrote:
[...]
Nevertheless: passing in 0 seems to be the safe bet in general and I wonder what is actually breaking. I haven't seen a traceback be attached at either bug. Also, those bugs should probably be marked as duplicates.
You are right, looking at the problem again i suggest to add this change to zope.publisher.xmlrpc
Uhhhm. Why are we changing this? IMHO passing 0 should work and I don't see what the actual breakage is.
- --- src/zope/publisher/xmlrpc.py (revision 100356) +++ src/zope/publisher/xmlrpc.py (working copy) @@ -46,10 +46,14 @@ 'See IPublisherRequest' # Parse the request XML structure
- - # 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()) + # XXX using readline() instead of readlines() + # as readlines() is not working with + # paster.httpserver + line = 1 + lines = '' + while line != '': + line = self._body_instream.readline() + lines += line self._args, function = xmlrpclib.loads(lines)
I'm fine with the patch. I just don't understand why we need it. :/ Here's a small readability suggestion: lines = '' while True: line = self._body_instream.readline() if not line: break lines += line I think assigning assigning an unused value can lead to confusions and the head-controlled loop obfuscates whats actually going on. Cheers, Christian -- Christian Theune · ct@gocept.com gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1 Zope and Plone consulting and development