Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.

Fix ascii error when thrift file has chinese chars. #314

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

KevinMyDing
Copy link

No description provided.

@@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

py2.7 has no keyword argument encoding. So maybe it's better to read the file in binary mode and decode it to utf-8.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants