Standard streams mode under win32

Patrick Mézard pmezard at gmail.com
Thu Feb 22 22:13:49 UTC 2007


Hello,

Given the number of Mercurial issues related to standard streams 
operating in text mode rather than binary under win32, wouldn't it be 
simpler to set them to binary mode at application startup ?

I have no experience with this kind of code: do you see any show 
stoppers for command line usage ? I expect people writing client scripts 
to be able to handle this kind of stuff. If we need it, text output can 
be faked in binary mode, the opposite cannot.

Finally, the current way to change streams mode is to call 
msvcrt.setmode, about which the MSDN states:
"""
If you apply _setmode to the file descriptor for a stream, call _setmode 
before performing any input or output operations on the stream.
"""
Switching modes back and forth is obviously not supported, even if I did 
not had any problem with it until now.

What do you think ?

--
Patrick Mézard



More information about the Mercurial-devel mailing list