[New-bugs-announce] [issue10479] cgitb.py should assume a binary stream for output
report at bugs.python.org
Sun Nov 21 06:37:17 CET 2010
New submission from Glenn Linderman <v+python at g.nevcal.com>:
The CGI interface is a binary stream, because it is pumped directly to/from the HTTP protocol, which is a binary stream.
Hence, cgitb.py should produce binary output. Presently, it produces text output.
When one sets stdout to a binary stream, and then cgitb intercepts an error, cgitb fails.
Demonstration of problem:
sys.stdout = open("sob", "wb") # WSGI sez data should be binary, so stdout should be binary???
fhb = open("fhb", "wb")
fhb.write("abcdef") # try writing non-binary to binary file. Expect an error, of course.
title: cgitb.py should assume a binary stream for output
versions: Python 3.2
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce