durusmail: quixote-users: Premature end of web page w/ IE6
Premature end of web page w/ IE6
2002-01-23
2002-01-23
2002-01-23
2002-01-23
Premature end of web page w/ IE6
Neil Schemenauer
2002-01-23
On Wed, Jan 23, 2002 at 04:58:28PM -0800, Greg Stein wrote:
> I would seriously doubt that Apache is mucking with the *body* of the file.

Me too. Not explicitly anyhow.  I suspect it has something to do with
the binary/text open() flag that actually means something on Windows.

[hacks on home Windows PC a bit]

As I suspected, when Apache runs a Python CGI script, sys.stdout is
opened in text mode.  I don't know if it's Apache or Python that decides
this but here's a bit of code to change it to binary (found in the
Active State cookbook):

    import sys

    if sys.platform == "win32":
        import os, msvcrt
        msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)

I'll see about integrating this into Quixote.  David, could you could
try testing IE6 after adding this bit of code to your Quixote CGI script
and re-enabling the content-length header?

  Neil


reply