diff mercurial/util.py @ 1420:b32b3509c7ab

Avoid insertion/deletion of CRs on stdio during hg serve
author olivier.maquelin@intel.com
date Mon, 24 Oct 2005 14:34:48 -0700
parents c6e6ca96a033
children 4babaa52badf
line wrap: on
line diff
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -390,6 +390,7 @@ else:
 
 # Platform specific variants
 if os.name == 'nt':
+    demandload(globals(), "msvcrt")
     nulldev = 'NUL:'
     
     try:
@@ -438,6 +439,9 @@ if os.name == 'nt':
     def set_exec(f, mode):
         pass
 
+    def set_binary(fd):
+        msvcrt.setmode(fd.fileno(), os.O_BINARY)
+
     def pconvert(path):
         return path.replace("\\", "/")
 
@@ -484,6 +488,9 @@ else:
         else:
             os.chmod(f, s & 0666)
 
+    def set_binary(fd):
+        pass
+
     def pconvert(path):
         return path