On Wed, 2009-03-18 at 13:12 +0100, Michael Haubenwallner wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Michael Haubenwallner wrote: > > When using paste.httpserver instead of twisted.wsgi server > > zope.publisher.xmlrpc.XMLRPCRequest.processInputs() hangs when reading 0 > > Bytes from the request (wsgi.input <socket._fileobject object>). > > > > As i found the zope.publisher.http.HTTPInputStream.readlines() signature > > was changed 3 years ago > > from readlines(self, hint=None) > > to readlines(self, hint=0) > > http://svn.zope.org/Zope3/trunk/src/zope/publisher/http.py?rev=66941&r1=66940&r2=66941 > > > > Do you think we could revert the change? > > > > Bugs reported: > > zopeproject: https://bugs.launchpad.net/zope3/+bug/283089 > > grokproject: https://bugs.launchpad.net/grok/+bug/332063 > > > > Bump - maybe my description was too complicated, but the issue is serious: > > XMLRPC is broken at least with paste.httpserver > > Any input on the implications of reverting the change in revision #66941?
I've looked at the various APIs of actual objects that need to consume the size hint parameter (cStringIO, StringIO, file, socket._fileobject). All of them should be fine getting a 0 as an argument, but file and cStringIO will break if they get `None` instead of 0: Type | readlines() | readlines(None) | readlines(0) ------------------------+-------------+-----------------+-------------- file | works | TypeError | works StringIO | works | works | works cStringIO | works | TypeError | works socket._fileobject [1]_ | works | works | works .. [1] I've only looked at the code and reasoned about this. What I'm puzzled about is that the commit message of 66491 mentions compatibility to StringIO but that would have worked just fine with `None`. So this either actually means "compatibility with file" or "compatibility with cStringIO". 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. Christian -- Christian Theune · c...@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 -- Christian Theune · c...@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
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )