From e9eeb05bcd8ea65f640157308026fe3c7db64dd4 Mon Sep 17 00:00:00 2001 From: "yingda.chen" Date: Tue, 13 Sep 2022 18:04:01 +0800 Subject: [PATCH] [to #42322933] specify ast scan file open encoding Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10090797 * [to #42322933] specify ast scan file open encoding --- modelscope/utils/ast_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modelscope/utils/ast_utils.py b/modelscope/utils/ast_utils.py index 263a81b3..62c31397 100644 --- a/modelscope/utils/ast_utils.py +++ b/modelscope/utils/ast_utils.py @@ -394,7 +394,7 @@ class AstScaning(object): def generate_ast(self, file): self._refresh() - with open(file, 'r') as code: + with open(file, 'r', encoding='utf8') as code: data = code.readlines() data = ''.join(data)