# HG changeset patch # User Dimitri Papadopoulos # Date 1380185197 -7200 # Node ID 5d5b3a865eb18192fd473e8bd8b1f65417775928 # Parent 0f2b80078aebafdfd6974e2dc113b8cd7614d41c [ctl] set proper encoding for sys.stdout/sys.stderr. Closes #1669144 diff -r 0f2b80078aeb -r 5d5b3a865eb1 cwctl.py --- 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)