bundle2: make sure standard stream are binary stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 15 May 2014 23:53:21 -0700
branchstable
changeset 21547 565d45919db8
parent 21544 667df8f478d1
child 21550 b4f0e15d1dab
child 21556 5e13507a3b4e
bundle2: make sure standard stream are binary Python on Windows apparently use encoded stream by default. We use the same trick than elsewhere in the code to make them binary. This should fix the current buildbot failure on windows.
tests/test-bundle2.t
--- a/tests/test-bundle2.t	Tue May 20 13:55:08 2014 -0700
+++ b/tests/test-bundle2.t	Thu May 15 23:53:21 2014 -0700
@@ -8,6 +8,14 @@
   > code. We still need to be able to test it while it grow up.
   > """
   > 
+  > try:
+  >     import msvcrt
+  >     msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
+  >     msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+  >     msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
+  > except ImportError:
+  >     pass
+  > 
   > import sys
   > from mercurial import cmdutil
   > from mercurial import util