[Python-checkins] CVS: python/nondist/peps pep-0042.txt,1.22,1.23

Barry Warsaw python-dev@python.org
Mon, 25 Sep 2000 15:07:47 -0700


Update of /cvsroot/python/python/nondist/peps
In directory slayer.i.sourceforge.net:/tmp/cvs-serv20937

Modified Files:
	pep-0042.txt 
Log Message:
Describe feature request for cgi.py's FieldStorage class to improve
memory consumption in the face of large binary uploads.  Closes bug
#110674.


Index: pep-0042.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0042.txt,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** pep-0042.txt	2000/09/25 15:59:01	1.22
--- pep-0042.txt	2000/09/25 22:07:45	1.23
***************
*** 140,143 ****
--- 140,160 ----
        https://sourceforge.net/bugs/?func=detailbug&bug_id=110678&group_id=5470
  
+     - cgi.py's FieldStorage class should be more conservative with
+       memory in the face of large binary file uploads.
+ 
+       https://sourceforge.net/bugs/?func=detailbug&bug_id=110674&group_id=5470
+ 
+       There are two issues here: first, because
+       read_lines_to_outerboundary() uses readline() it is possible
+       that a large amount of data will be read into memory for a
+       binary file upload.  This should probably look at the
+       Content-Type header of the section and do a chunked read if it's
+       a binary type.
+ 
+       Second, because the lines that are read are stored in an
+       instance attribute (self.lines -- a list), the uploaded data is
+       never freed.  self.lines isn't definied as part of the public
+       interface it /might/ be safe to remove it.  OTOH, removing it
+       will break code clever and nosy code.
  
  Tools