From 3a73f7b9b19e135bf139a64e2e1654cf136150ee Mon Sep 17 00:00:00 2001 From: FrogGuaGuaGua <37178630+FrogGuaGuaGua@users.noreply.github.com> Date: Mon, 25 Mar 2024 16:55:51 +0800 Subject: [PATCH] Update generate_proto_list.py (#6523) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Chinese Windows System,”open“ will generate error: self.contents = file.read() ^^^^^^^^^^^ UnicodeDecodeError: 'gbk' codec can't decode byte 0x93 in position 547: illegal multibyte sequence --- scripts/packaging/generate_proto_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/packaging/generate_proto_list.py b/scripts/packaging/generate_proto_list.py index dcaafa0496d..2d5baece90e 100644 --- a/scripts/packaging/generate_proto_list.py +++ b/scripts/packaging/generate_proto_list.py @@ -44,7 +44,7 @@ def __init__(self, path, name): self.needs_robot_ancestor = False # store file contents to avoid reading it multiple times - with open(self.path, 'r') as file: + with open(self.path, 'r', encoding='utf-8') as file: self.contents = file.read() # remove IndexedFaceSet related fields since they significantly slow down the subsequent regex self.contents = re.sub(r'point\s+\[[^\]]+\]', '', self.contents)