[Python-checkins] CVS: python/dist/src/Lib cgi.py,1.55,1.56

Barry Warsaw python-dev@python.org
Mon, 6 Nov 2000 10:46:11 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv7854

Modified Files:
	cgi.py 
Log Message:
This fixes several bug reports concering memory bloating during large
file uploads.

In response to SF bugs 110674 and 119806, and discussions on
python-dev, we are removing the self.lines attribute from the
FieldStorage class.  Specifically touched where methods __init__(),
read_lines_to_eof(), and skip_lines().

No one can remember why self.lines was added.  Technically, it's part
of the public interface for the class, but it was never documented.
It's possible clever or nosy code will break because of this, but it
was decided to remove it and see who complains.

This resolution also closes the second half of the cgi.py entry in PEP
42.  The first half of that PEP concerns specifically binary file
uploads, where there may be no end-of-line marker for a very long
time.  This patch does not address that issue.


Index: cgi.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/cgi.py,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -r1.55 -r1.56
*** cgi.py	2000/10/03 13:51:09	1.55
--- cgi.py	2000/11/06 18:46:09	1.56
***************
*** 20,24 ****
  # 
  
! __version__ = "2.4"
  
  
--- 20,24 ----
  # 
  
! __version__ = "2.5"
  
  
***************
*** 498,502 ****
          self.list = self.file = None
          self.done = 0
-         self.lines = []
          if ctype == 'application/x-www-form-urlencoded':
              self.read_urlencoded()
--- 498,501 ----
***************
*** 634,638 ****
                  self.done = -1
                  break
-             self.lines.append(line)
              self.file.write(line)
  
--- 633,636 ----
***************
*** 647,651 ****
                  self.done = -1
                  break
-             self.lines.append(line)
              if line[:2] == "--":
                  strippedline = string.strip(line)
--- 645,648 ----
***************
*** 677,681 ****
                  self.done = -1
                  break
-             self.lines.append(line)
              if line[:2] == "--":
                  strippedline = string.strip(line)
--- 674,677 ----