From 35ddf50b4d7ac10c741ffe7166b69d79e055f842 Mon Sep 17 00:00:00 2001 From: Kyle Ding Date: Tue, 21 Nov 2017 15:05:25 +0800 Subject: [PATCH] Fix utf-8 error. --- thriftpy/parser/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thriftpy/parser/parser.py b/thriftpy/parser/parser.py index f65320a..4f1c77d 100644 --- a/thriftpy/parser/parser.py +++ b/thriftpy/parser/parser.py @@ -540,7 +540,7 @@ def parse(path, module_name=None, include_dirs=None, include_dir=None, with open(urlparse(path).netloc + urlparse(path).path) as fh: data = fh.read() elif url_scheme == '': - with open(path) as fh: + with open(path, encoding='utf-8') as fh: data = fh.read() elif url_scheme in ('http', 'https'): data = urlopen(path).read()