[PATCH 5 of 6] encode all output in stdio encoding

Andrey grooz-work at gorodok.net
Sun Nov 12 17:49:28 UTC 2006


# HG changeset patch
# User Andrey <grooz-work at gorodok.net>
# Date 1163348933 -21600
# Node ID 8f8a0670762c144c809904f50a3f8cdc1a012568
# Parent  d71ed9fe6ca3b419a8b2f19f3be140776b702129
encode all output in stdio encoding

diff -r d71ed9fe6ca3 -r 8f8a0670762c mercurial/ui.py
--- a/mercurial/ui.py	Sun Nov 12 22:17:22 2006 +0600
+++ b/mercurial/ui.py	Sun Nov 12 22:28:53 2006 +0600
@@ -387,17 +387,17 @@ class ui(object):
                 self.write(*self.header)
             self.header = []
         for a in args:
-            sys.stdout.write(str(a))
+            sys.stdout.write(self.encode(a, 'stdio'))
 
     def write_header(self, *args):
         for a in args:
-            self.header.append(str(a))
+            self.header.append(self.encode(a, 'stdio'))
 
     def write_err(self, *args):
         try:
             if not sys.stdout.closed: sys.stdout.flush()
             for a in args:
-                sys.stderr.write(str(a))
+                sys.stderr.write(self.encode(a, 'stdio'))
         except IOError, inst:
             if inst.errno != errno.EPIPE:
                 raise



More information about the Mercurial-devel mailing list