[Python-Dev] cgi.py and huge uploads problem

Barry A. Warsaw barry@wooz.org
Mon, 6 Nov 2000 13:32:44 -0500 (EST)


>>>>> "GvR" == Guido van Rossum <guido@python.org> writes:

    GvR> You know, I have *no* idea why this is.  I have looked
    GvR> through various revisions (this feature is as old as
    GvR> cgi.py:1.8) and cannot find any use of or need for
    GvR> self.lines!  It just gets appended to.

    GvR> So I think it's safe to toss all the references to self.lines
    GvR> and see who complains.

There are two bug reports related to this in the SF database.  The
first one was 110674, which we closed after adding the feature request
to PEP 42.  The second is 119806, which looks fairly new, but wasn't
submitted by Chris or Joachim.

I came to the same conclusion Guido does above when I looked at 110674
in the Python 2.0 time frame, but didn't feel comfortable making that
change for 2.0.  I think it's correct to make the change now.

I will do the following:

- remove self.lines from cgi.py
- close bug #119806
- update pep 42

Attached below is the patch.

-Barry

-------------------- snip snip --------------------
Index: cgi.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/cgi.py,v
retrieving revision 1.55
diff -u -r1.55 cgi.py
--- cgi.py	2000/10/03 13:51:09	1.55
+++ cgi.py	2000/11/06 18:32:18
@@ -497,7 +497,6 @@
 
         self.list = self.file = None
         self.done = 0
-        self.lines = []
         if ctype == 'application/x-www-form-urlencoded':
             self.read_urlencoded()
         elif ctype[:10] == 'multipart/':
@@ -633,7 +632,6 @@
             if not line:
                 self.done = -1
                 break
-            self.lines.append(line)
             self.file.write(line)
 
     def read_lines_to_outerboundary(self):
@@ -646,7 +644,6 @@
             if not line:
                 self.done = -1
                 break
-            self.lines.append(line)
             if line[:2] == "--":
                 strippedline = string.strip(line)
                 if strippedline == next:
@@ -676,7 +673,6 @@
             if not line:
                 self.done = -1
                 break
-            self.lines.append(line)
             if line[:2] == "--":
                 strippedline = string.strip(line)
                 if strippedline == next: