From a315ec1c0a821923778ed55d9d43af7736c05987 Mon Sep 17 00:00:00 2001 From: doctorpangloss <@hiddenswitch.com> Date: Thu, 20 Jun 2024 10:17:04 -0700 Subject: [PATCH] Assume JSON config files are text, utf-8 encoded --- comfy/component_model/files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comfy/component_model/files.py b/comfy/component_model/files.py index 4bddc7163..c4c9dfff8 100644 --- a/comfy/component_model/files.py +++ b/comfy/component_model/files.py @@ -27,10 +27,10 @@ def get_path_as_dict(config_dict_or_path: str | dict | None, config_path_inside_ else: if not os.path.exists(config_dict_or_path): with resources.as_file(resources.files(package) / config_path_inside_package) as config_path: - with open(config_path) as f: + with open(config_path, mode="rt", encoding="utf-8") as f: config = json.load(f) else: - with open(config_dict_or_path) as f: + with open(config_dict_or_path, mode="rt", encoding="utf-8") as f: config = json.load(f) elif isinstance(config_dict_or_path, dict): config = config_dict_or_path