git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] remote-hg: set stdout to binary mode on win32

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
May 19, 2013, 11:53 UTC
Message-ID
<1368964428-1059-1-git-send-email-felipe.contreras@gmail.com>
From: Amit Bakshi <ambakshi@gmail.com>

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.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/remote-helpers/git-remote-hg | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/contrib/remote-helpers/git-remote-hg b/contrib/remote-helpers/git-remote-hg
index beb864b..01555dc 100755
--- a/contrib/remote-helpers/git-remote-hg
+++ b/contrib/remote-helpers/git-remote-hg
@@ -954,6 +954,10 @@ def main(args):
     marks_path = os.path.join(dirname, 'marks-hg')
     marks = Marks(marks_path)
 
+    if sys.platform == 'win32':
+        import msvcrt
+        msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+
     parser = Parser(repo)
     for line in parser:
         if parser.check('capabilities'):
-- 
1.8.3.rc3.286.g3d43083
Next: Felipe Contreras
Message 1 of 3 in “remote-hg: set stdout to binary mode on win32”
  1. remote-hg: set stdout to binary mode on win32Felipe Contreras, May 19, 2013
  2. Felipe ContrerasMay 19, 2013
  3. Junio C HamanoMay 20, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.