[issue4953] cgi module cannot handle POST with multipart/form-data in 3.0

R. David Murray report at bugs.python.org
Wed Jan 5 04:35:11 CET 2011


R. David Murray <rdmurray at bitdance.com> added the comment:

A day late, but I've looked at the patch.

Now, I'm not all that knowledgeable about CGI, so other people will probably want to chime in here....

First, I'm uploading a new version of the patch as an svn diff (can be applied to a checkout using 'patch -p0 <patchfile' from the top level directory of the checkout).  This includes Pierre's patch unchanged, and includes changes to test_cgi so that Pierre's patch is tested.  Some of the tests fail.

A couple of the failures have to do with file bodies being returned as binary when previously they were returned as strings.  This raises the issue of backward compatibility: if cgi/fieldstorage using applications exist for 3.1, changing this will break them.  There may not be a good solution to that problem.  But it also may not be possible to fix this in 3.2 at this point (which I seem to have already decided earlier, but I can't now remember why...).

>From looking over the cgi code it is not clear to me whether Pierre's approach is simpler or more complex than the alternative approach of starting with binary input and decoding as appropriate.  From a consistency perspective I would prefer the latter, but I don't know if I'll have time to try it out before rc1.

I also wonder if it would be possible to rewrite FieldStorage to take even better advantage of FeedParser, but if so that would *certainly* not happen before rc1.

----------
keywords: +patch
Added file: http://bugs.python.org/file20269/cgi_plus_tests.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4953>
_______________________________________


More information about the Python-bugs-list mailing list