From af54b13174dc5d013dc04bdb0be5784ca269982a Mon Sep 17 00:00:00 2001 From: Virgil Date: Tue, 8 Apr 2014 19:56:50 +0800 Subject: [PATCH] Support locale of China and so on. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Goagent在中文界面下的ubuntu运行会报错,所以稍稍改了一下。 --- local/proxy.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/local/proxy.py b/local/proxy.py index 12da8431..bf4af516 100644 --- a/local/proxy.py +++ b/local/proxy.py @@ -43,6 +43,11 @@ import os import glob +default_encoding = 'utf-8' +if sys.getdefaultencoding() != default_encoding: + reload(sys) + sys.setdefaultencoding(default_encoding) + sys.dont_write_bytecode = True sys.path += glob.glob('%s/*.egg' % os.path.dirname(os.path.abspath(__file__)))