提交 e5cb6178 编写于 作者: W wuzewu

Fix model installation failure caused by coding problems under windows

上级 3b5d7f7b
......@@ -15,6 +15,7 @@
import ast
import builtins
import codecs
import inspect
import os
import re
......@@ -107,7 +108,7 @@ class RunModule(object):
req_file = os.path.join(directory, 'requirements.txt')
if not os.path.exists(req_file):
return []
with open(req_file, 'r') as file:
with codecs.open(req_file, 'r', encoding='utf8') as file:
return file.read().split('\n')
@property
......@@ -229,7 +230,7 @@ class Module(object):
# If is ModuleV2
module_file = os.path.join(directory, 'module.py')
with open(module_file, 'r') as file:
with codecs.open(module_file, 'r', encoding='utf8') as file:
pycode = file.read()
ast_module = ast.parse(pycode)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册