From 62d87087f86eb4af38b4d3b6b1b923c252181b77 Mon Sep 17 00:00:00 2001 From: "dr.lt.data" Date: Thu, 11 Jan 2024 16:19:41 +0900 Subject: [PATCH] fix: error by encoding other than utf-8 --- __init__.py | 2 +- prestartup_script.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/__init__.py b/__init__.py index 2b58c29f..3d41afaa 100644 --- a/__init__.py +++ b/__init__.py @@ -28,7 +28,7 @@ except: print(f"[WARN] ComfyUI-Manager: Your ComfyUI version is outdated. Please update to the latest version.") -version = [1, 25, 3] +version = [1, 25, 4] version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') print(f"### Loading: ComfyUI-Manager ({version_str})") diff --git a/prestartup_script.py b/prestartup_script.py index 0c764c37..0328849a 100644 --- a/prestartup_script.py +++ b/prestartup_script.py @@ -135,7 +135,7 @@ try: is_start_mode = True is_import_fail_mode = False - log_file = open(f"comfyui{postfix}.log", "w", encoding="utf-8") + log_file = open(f"comfyui{postfix}.log", "w", encoding="utf-8", errors="ignore") log_lock = threading.Lock() class ComfyUIManagerLogger: @@ -338,7 +338,7 @@ if os.path.exists(restore_snapshot_path): cmd_str = [sys.executable, git_script_path, '--apply-snapshot', restore_snapshot_path] exit_code = process_wrap(cmd_str, custom_nodes_path, handler=msg_capture) - with open(restore_snapshot_path, 'r', encoding="UTF-8") as json_file: + with open(restore_snapshot_path, 'r', encoding="UTF-8", errors="ignore") as json_file: info = json.load(json_file) for url in cloned_repos: try: @@ -352,7 +352,7 @@ if os.path.exists(restore_snapshot_path): this_exit_code = 0 if os.path.exists(requirements_path): - with open(requirements_path, 'r', encoding="UTF-8") as file: + with open(requirements_path, 'r', encoding="UTF-8", errors="ignore") as file: for line in file: package_name = line.strip() if package_name and not is_installed(package_name): @@ -413,7 +413,7 @@ if os.path.exists(script_list_path): executed = set() # Read each line from the file and convert it to a list using eval - with open(script_list_path, 'r', encoding="UTF-8") as file: + with open(script_list_path, 'r', encoding="UTF-8", errors="ignore") as file: for line in file: if line in executed: continue