Le Thu, 29 Apr 2010 18:33:08 +0200, Dodo a écrit :
> 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()

Sorry, I should have been clearer. You have to flush sys.stdout before 
using sys.stdout.buffer, such that the unicode layer doesn't keep any 
unwritten data. So this should be:

                sys.stdout.flush()
                sys.stdout.buffer.write( f.read() )

Regards

Antoine.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to