mercurial/utils/procutil.py
branchstable
changeset 38455 0b63a6743010
parent 37464 632b92899203
child 38525 c153f440682f
--- a/mercurial/utils/procutil.py	Tue Jun 19 22:45:52 2018 +0900
+++ b/mercurial/utils/procutil.py	Mon Jun 25 16:36:14 2018 +0200
@@ -42,9 +42,13 @@
 
 # glibc determines buffering on first write to stdout - if we replace a TTY
 # destined stdout with a pipe destined stdout (e.g. pager), we want line
-# buffering
+# buffering (or unbuffered, on Windows)
 if isatty(stdout):
-    stdout = os.fdopen(stdout.fileno(), r'wb', 1)
+    if pycompat.iswindows:
+        # Windows doesn't support line buffering
+        stdout = os.fdopen(stdout.fileno(), r'wb', 0)
+    else:
+        stdout = os.fdopen(stdout.fileno(), r'wb', 1)
 
 if pycompat.iswindows:
     from .. import windows as platform