Jakub Kulik <kulik...@gmail.com> added the comment:
We internally tested the most recent PR and found some issues with it: https://github.com/python/cpython/pull/21457#issuecomment-698845895 We ended up using a much simpler patch, which seems to work as expected. --- Python-3.7.8/Lib/cgi.py +++ Python-3.7.8/Lib/cgi.py @@ -703,7 +703,10 @@ if not data: self.done = -1 break - self.file.write(data) + if self._binary_file: + self.file.write(data) + else: + self.file.write(data.decode()) todo = todo - len(data) def read_lines(self): ---------- nosy: +kulikjak _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue27777> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com