[PATCH STABLE] win32: assign winstdout to sys.__stdout__ as well (issue2888)

Idan Kamara idankk86 at gmail.com
Sat Jul 16 12:24:52 UTC 2011


# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1310819068 -10800
# Node ID d16921e0d3cd98f75b9ec312c3eb386f662a0053
# Parent  926c90623182540929d56ba2500f88f42e8328e5
win32: assign winstdout to sys.__stdout__ as well (issue2888)

On Windows sys.stdout was being replaced with winstdout, which caused
util.system() to redirect its output (due to 406b6d7bdcb9). That causes
interactive tools (such as vim) to stop working.

diff -r 926c90623182 -r d16921e0d3cd mercurial/windows.py
--- a/mercurial/windows.py	Sat Jul 09 19:06:59 2011 +0300
+++ b/mercurial/windows.py	Sat Jul 16 15:24:28 2011 +0300
@@ -62,7 +62,7 @@
             self.close()
             raise IOError(errno.EPIPE, 'Broken pipe')
 
-sys.stdout = winstdout(sys.stdout)
+sys.__stdout__ = sys.stdout = winstdout(sys.stdout)
 
 def _is_win_9x():
     '''return true if run on windows 95, 98 or me.'''



More information about the Mercurial-devel mailing list