cwctl.py
branchstable
changeset 9318 5d5b3a865eb1
parent 9315 5298cfb132e6
child 9323 29d2f15cf596
--- a/cwctl.py	Thu Sep 19 22:33:52 2013 +0200
+++ b/cwctl.py	Thu Sep 26 10:46:37 2013 +0200
@@ -1055,8 +1055,13 @@
 def run(args):
     """command line tool"""
     import os
+    import codecs
+    encoding = sys.stdout.encoding
     sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
+    sys.stdout = codecs.getwriter(encoding)(sys.stdout)
+    encoding = sys.stderr.encoding
     sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0)
+    sys.stderr = codecs.getwriter(encoding)(sys.stderr)
     cwcfg.load_cwctl_plugins()
     try:
         CWCTL.run(args)