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

STINNER Victor report at bugs.python.org
Mon Jan 10 22:29:00 CET 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

> I set an attribute encoding to self.fp because, for each part 
> of a multipart/form-data, a new instance of FieldStorage is created,
> and this instance needs to know how to decode bytes.

Set fp.encoding may raise an error (eg. for a read-only object, or an object implemented in C). You should add a new argument to the constructor.

> Maybe I'm missing something here, but sys.stdin is always
> a TextIOWrapper instance, even if set to binary mode

I mean: you should pass sys.stdin.buffer instead of sys.stdin.

----------

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


More information about the Python-bugs-list mailing list