Skip to content

Commit 5dbe064

Browse files
ambakshigitster
authored andcommitted
remote-hg: set stdout to binary mode on win32
git clone hangs on windows, and file.write would return errno 22 inside of mercurial's windows.winstdout wrapper class. This patch sets stdout's mode to binary, fixing both issues. [fc: cleaned up] Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent de3a5c6 commit 5dbe064

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

contrib/remote-helpers/git-remote-hg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,10 @@ def main(args):
954954
marks_path = os.path.join(dirname, 'marks-hg')
955955
marks = Marks(marks_path)
956956

957+
if sys.platform == 'win32':
958+
import msvcrt
959+
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
960+
957961
parser = Parser(repo)
958962
for line in parser:
959963
if parser.check('capabilities'):

0 commit comments

Comments
 (0)