Message121865
| Author |
v+python |
| Recipients |
v+python |
| Date |
2010年11月21日.05:37:14 |
| SpamBayes Score |
5.896079e-08 |
| Marked as misclassified |
No |
| Message-id |
<1290317837.02.0.152908438377.issue10479@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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:
import sys
import traceback
sys.stdout = open("sob", "wb") # WSGI sez data should be binary, so stdout should be binary???
import cgitb
sys.stdout.write(b"out")
fhb = open("fhb", "wb")
cgitb.enable()
fhb.write("abcdef") # try writing non-binary to binary file. Expect an error, of course. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年11月21日 05:37:17 | v+python | set | recipients:
+ v+python |
| 2010年11月21日 05:37:17 | v+python | set | messageid: <1290317837.02.0.152908438377.issue10479@psf.upfronthosting.co.za> |
| 2010年11月21日 05:37:14 | v+python | link | issue10479 messages |
| 2010年11月21日 05:37:14 | v+python | create |
|