[python-win32] String weirdness on python 2.4 / windows

Justin Ezequiel justin.mailinglists at gmail.com
Thu Oct 20 03:44:22 CEST 2005


> Date: Thu, 20 Oct 2005 10:04:24 +1000
> From: Kinsley Turner <kingsleyturner at westpac.com.au>
>
> I checked the icon, it seemed to be ok.  I'm unfamiliar with win32
> tools, but it seemed that the data being delivered from the socket
> rendered differently from a python print() compared to a terminal
> 'type icon.ico'.  I cut the code out and tested it in isolation - this
> showed it to be flawless.  Despite appearing correct in other software
> the binary identical icon appears broken in IE 6.<something>.

for what its worth, had a similar problem serving up images from a
Python CGI script running on Apache on WinXP.

what worked for me was adding the "-u" switch to the shebang
#!E:\Python23\python.exe -u

-u     : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)
         see man page for details on internal buffering relating to '-u'

hope this helps


More information about the Python-win32 mailing list