[PATCH 4 of 8] encode all output in stdio encoding

Andrey grooz-work at gorodok.net
Mon Nov 20 10:29:54 UTC 2006


# HG changeset patch
# User Andrey <grooz-work at gorodok.net>
# Date 1163471414 -21600
# Node ID ad1e778d48b8e6ae6a75dd5b1cebf854f9fbc0e4
# Parent  2e2cc18a4e6dd837305f247ff5e2046084e77960
encode all output in stdio encoding

diff -r 2e2cc18a4e6d -r ad1e778d48b8 mercurial/ui.py
--- a/mercurial/ui.py	Sun Nov 12 22:08:10 2006 +0600
+++ b/mercurial/ui.py	Tue Nov 14 08:30:14 2006 +0600
@@ -389,13 +389,13 @@ class ui(object):
 
     def write(self, *args):
         for a in args:
-            sys.stdout.write(str(a))
+            sys.stdout.write(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