Graham Dumpleton <graham.dumple...@gmail.com> added the comment:

FWIW, keep in mind that cgi.FieldStorage is also quite often used in WSGI 
scripts in arbitrary WSGI servers which have got nothing to do with CGI. Having 
cgi.FieldStorage muck around with stdout/stderr under WSGI, even where using a 
CGI/WSGI bridge, would potentially be a bad thing to do, especially in embedded 
systems like mod_wsgi where sys.stdout and sys.stderr are replaced with file 
like objects that map onto Apache error logging. Even in non embedded systems, 
you could very well screw up any application logging done via stdout/stderr and 
break the application.

So, the default or common code paths should never play with sys.stdout or 
sys.stderr. It is already a PITA that the implementation falls back to using 
sys.argv when QUERY_STRING isn't defined which also could produce strange 
results under a WSGI server. In other words, please don't go adding any more 
code which makes the wrong assumption that this is only used in CGI scripts.

----------
nosy: +grahamd

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4953>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to