W95 binary output from CGI script

Tom Hall tlhall at blackhole.nyx.net
Tue Jun 22 22:44:46 CEST 1999


I'm working on a CGI script for Windows 95, and trying to send
binary data out stdout. Every time I try to send a \x0a it spits
out \x0d\x0a. This really messes up a JPEG, for example.

How can I get python to print just \x0a ?
I've tried
   sys.stdout.write("\x0a")
and
   rawout=os.fdopen(sys.stdout.fileno(),"wb")
   rawout.write("\x0a")
and even
   rawout=os.fdopen(sys.stdout.fileno(),"wb")
   os.write(rawout.fileno(),"\x0a")
but I still get that damn \x0d.

How do I send only the binary data I want out to stdout ?





More information about the Python-list mailing list