[issue12411] cgi.parse_multipart is broken on 3.x

Tal Einat report at bugs.python.org
Mon Jul 4 14:11:24 CEST 2011


Tal Einat <taleinat at gmail.com> added the comment:

Yes, please submit the other additional tests in a separate issue.

The default value for boundary should surely be b"". A simple test should be added where cgi.parse_multipart() uses the default boundary.

If valid_boundary() is used only for cgi.parse_multipart() then it should be changed to validate that the boundary is a bytes instance (which would also make it simpler). Otherwise (if vaild_boundary() is also used elsewhere) cgi.parse_multipart() should itself check that the boundary is indeed a bytes instance, throwing a TypeError otherwise.

Tip: You should run the relevant tests, making sure they all pass, before submitting a patch. That way you really know that the patch actually works (as far as passing all of the tests).

Thanks for adding more stdlib tests :)

----------

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


More information about the Python-bugs-list mailing list