Skip to content

Commit

Permalink
Update generate_proto_list.py (#6523)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
FrogGuaGuaGua authored Mar 25, 2024
1 parent af596b4 commit 3a73f7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/packaging/generate_proto_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3a73f7b

Please sign in to comment.