This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author smurfix
Recipients smurfix
Date 2014-06-10.11:57:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1402401424.17.0.414317354507.issue21705@psf.upfronthosting.co.za>
In-reply-to
Content
This code in cgi.py makes no sense whatsoever:

842                 if line.endswith(b"--") and last_line_lfend:
843                     strippedline = line.strip()
844                     if strippedline == next_boundary:
845                         break
846                     if strippedline == last_boundary:
847                         self.done = 1
848                         break

(Pdb) p next_boundary
b'--testdata'
(Pdb) p last_boundary
b'--testdata--'
(Pdb) 

The net effect of this is that parsing a multipart with more than one file in it is impossible, as the first file's reader will gobble up the remainder of the input.

Patch attached.

I guess it's a safe bet that no sane person even uses cgi.py any more, otherwise this would have been discovered a bit sooner.
History
Date User Action Args
2014-06-10 11:57:04smurfixsetrecipients: + smurfix
2014-06-10 11:57:04smurfixsetmessageid: <1402401424.17.0.414317354507.issue21705@psf.upfronthosting.co.za>
2014-06-10 11:57:04smurfixlinkissue21705 messages
2014-06-10 11:57:03smurfixcreate