[mod_python] Large req.writes prevent header from being outputted?

Gregory Trubetskoy grisha at modpython.org
Tue Jan 23 22:45:46 EST 2001


Mike - 

I'm not able to reproduce this. I just tried something similar with an 8Mb
file, and I get all the headers and data correctly.

Anyone else seeing this behaviour?

Could the problem be something with your client? I used wget -S to test my
results.

--
  Gregory (Grisha) Trubetskoy
       grisha at modpython.org

On Mon, 22 Jan 2001, Mike Bell wrote:

> With my installation (mod_python 2.7.1 w/python 2.0), doing
> 
>   req.content_type = DetermineMimeType(filepath)
>   req.send_http_header()
>   myjpeg = open(filepath)
>   req.write(myjpeg.read())
> 
> with a very large image (appears to be around 1/4MB) will result in an HTTP
> transaction where no headers are outputted, just binary data. However,
> something like
> 
>   req.content_type = DetermineMimeType(filepath)
>   req.send_http_header()
>   myjpeg = open(filepath)
>   while 1:
>     temp = myjpeg.read(65535)
>     if temp == "":
>       break
>     req.write(temp)
> 
> will work just fine.
> 
> Presumably req.write should work for these large values, or at least raise
> an exception rather than dropping data.
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
> 




More information about the Mod_python mailing list