zlib, gzip and HTTP compression.

Andrew MacIntyre andymac at bullseye.apana.org.au
Mon Jan 14 05:23:58 EST 2002


On 12 Jan 2002, Alan Kennedy wrote:

> Yes, that was exactly the problem. I am running on win2k and winnt4.
> By adding the lines
>
> import msvcrt
> msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
>
> The entire problem went away!

;-) glad you found a way to deal with this.

....

> So the character translation was happening on the file descriptor
> itself? Is that standard C behaviour? Has it been that long since I
> coded in C? :-) Even then, I never did any stdio coding on dos/win32.

It's been that way since the earliest days of C compilers (or more
correctly, their libraries) on DOS, AFAIK, not to mention other non-Unix
OSes.

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au  | Snail: PO Box 370
        andymac at pcug.org.au            |        Belconnen  ACT  2616
Web:    http://www.andymac.org/        |        Australia





More information about the Python-list mailing list