CGI python 3 write RAW BINARY

Dodo dodo_do_not_wake_up at yahoo.Fr
Thu Apr 29 17:43:16 EDT 2010


Le 29/04/2010 18:33, Dodo a écrit :
> Le 29/04/2010 17:07, Antoine Pitrou a écrit :
>> Le Thu, 29 Apr 2010 12:53:53 +0200, Dodo a écrit :
>>>
>>> @Antoine : It not sys.stdout.buffer.write but sys.stdout.write()
>>> instead. But it still doesn't work, now I have empty content
>>
>> Let me insist: please use sys.stdout.buffer.write().
>> You'll also have to call sys.stdout.flush() before doing so.
>>
>>
> Oh, I tested on my windows machine avec sys.stdout.buffer.write() didn't
> work.
> I just tested on my linux server, and it works....
>
> So, let's modify the script
>
> sys.stdout.buffer.write( f.read() )
> sys.stdout.flush()
>
> Now I have:
> malformed header from script. Bad header=ÿØÿà: show.py
> and it tells me Internal Server error :(
>
> I can't see the error messages (traceback)
> any idea to do so?
>
> Dorian

Ok, I just checked, the CRC of the file in the server is not the same 
the in the browser
I don't understand how the data could be modified...

Dorian



More information about the Python-list mailing list