Graham Dumpleton
Mon, 23 Jan 2006 11:42:30 -0800
On 24/01/2006, at 3:07 AM, Deron Meranda wrote:
On 1/23/06, Graham Dumpleton <[EMAIL PROTECTED]> wrote:Using "print" like that can't be done in an "eval", would need to use "exec".Sorry, I probably didn't mean to use the print in my example. Of course though you can always wrap sys.stdout if you wanted to capture the output for post-escaping.
You can't wrap sys.stdout or replace it for the purposes of a single request. This is because mod_python needs to be able to work in a multi thread MPM where multiple requests need to be handled at the same time. The cgihandler in mod_python does fiddle with sys.stdout, but to do that it has to lock on the cgihandler so only one at a time can run, thus affecting performance. Graham