提交 e5cb6178 编写于 作者: W wuzewu

Fix model installation failure caused by coding problems under windows

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