From 00b77ce73cc743c56551c43dbbe66362a5f9eb36 Mon Sep 17 00:00:00 2001 From: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Date: Mon, 3 Jun 2024 12:54:45 +0200 Subject: [PATCH] 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 ). --- python/servo/command_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 2ad49d1097d..fe4ed85cc83 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -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 = {}