It's being caused by a bug! Thanks for reporting this. Most other
configurations support the notion of output buffering, and thereby
flush(). The mod_python handler does not have a flush(), since the
write() function immediately writes to the client. For consistency
across different configurations, Spyce buffers on behalf of mod_python,
but when flush is called, it gets through to the base output object.
This has been fixed, and will be released in v1.3.11.
In any case, you really should not need to call flush(). It's called
automatically at the end of a request. The only time when it makes sense
is if you are need something to go out to the client immediately while
another, much longer operation continues at the server. You should be
aware to watch for other timeouts in the system if your operations is
Also be aware that your I/O performance (and usually also overall
performance, since most processing is I/O bound) should improve if you
flush less frequently and allow the system to take care of things.
All the best,
On Wed, 30 Apr 2003, Steven D. Arnold wrote:
>When I execute the following Spyce code with mod_python on, I get an error.
>The Spyce code is:
>[[ response.flush() ]]
>The error is:
>Stack: report-display.spy:55, in (main):
>/server/spyce/modules/response.py:79, in flush:
>/server/spyce/spyceModpy.py:85, in flush:
>/server/spyce/spyceUtil.py:141, in flush:
>raise AttributeError, attr
>This problem doesn't occur under CGI. Any idea what may be causing this?
>I'd appreciate being CC'ed on any responses since I seem to be having some
>trouble receiving the list right now.