mach: Read .servobuild as utf-8 (#32431)

Without this on my windows machine  `open` seems to default
to the `gbk` codec, and then fails to read the file if it
contains Windows style paths (e.g. both `ndk = D:\my_path` or
`ndk = D:\\my_path` cause the `f.read()` to fail ).
This commit is contained in:
Jonathan Schwender 2024-06-03 12:54:45 +02:00 committed by GitHub
parent 2ca6c4b52b
commit 00b77ce73c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -273,7 +273,7 @@ class CommandBase(object):
config_path = path.join(context.topdir, ".servobuild")
if path.exists(config_path):
with open(config_path) as f:
with open(config_path, "r", encoding="utf-8") as f:
self.config = toml.loads(f.read())
else:
self.config = {}