Bert JW Regeer added the comment: On line #890 in self.make_file() the check for _binary_file should be changed to also check for self.length >= 0.
https://github.com/python/cpython/blob/3.4/Lib/cgi.py#L890 becomes: if self._binary_file or self.length >= 0: _binary_file is only ever set if there is a content disposition, which there is not in the test case provided. In the case of no content disposition we can use the content-length as a hint that we have a file that has been uploaded. All files uploaded should be treated as binary if they are not a text type. This is a duplicate of #27308, however the patch in that report is incorrect IMHO. ---------- nosy: +X-Istence, haypo _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27777> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com