Issue 10480: cgi.py should document the need for binary stdin/stdout (original) (raw)

CGI is a bytestream protocol. Python assumes a text mode encoding for stdin and stdout, this is inappropriate for the CGI interface.

CGI should provide an API to "do the right thing" to make stdin and stout binary mode interfaces (including mscvrt setting to binary on Windows). Failing that, it should document the need to do so in CGI applications.

Failing that, it should be documented somewhere, CGI seems the most appropriate place to me.