Bugs item #1573931, was opened at 2006-10-09 18:34 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1573931&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: Python 2.4 Status: Open Resolution: None Priority: 5 Submitted By: Michael Kerrin (mkerrin) Assigned to: Nobody/Anonymous (nobody) Summary: WSGI, cgi.FieldStorage incompatibility Initial Comment: The WSGI specification says in the section on "Input and Error Streams": The optional "size" argument to readline() is not supported, as it may be complex for server authors to implement, and is not often used in practice. But the current implementation of cgi.FieldStorage in the 2.4.4 branch and on Python 2.5 does call readline with the size argument. It has started to do this in response to the Python bug #1112549 - cgi.FieldStorage memory usage can spike in line-oriented ops. See http://sourceforge.net/tracker/index.php?func=detail&aid=1112549&group_id=5470&atid=105470 I am not 100% sure wheather this is a bug in the WSGI application or cgi.FieldStorage class, Originally I thought it was cgi.FieldStorage that needs to be changed, and hence tried to fix it by wrapping the input stream so that the readline method always uses the read method on the input stream (so has to not to break the above mentioned bug). While this seems to work for me it introduces a level of complexity in the cgi.py file, and possible some other bugs, that makes me think that adding the size argument for readline into the WSGI specification isn't such bad idea after all. I have attached my patch against cgi.FieldStorage if any one thinks this is the best way of fixing this issue. This is an issue for Zope3 has Zope3 doesn't support the size argument and neither does Twisted from which Zope gets its input stream. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1573931&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com