diff --git a/angelica.py b/angelica.py index 38bf054..f8b2b28 100644 --- a/angelica.py +++ b/angelica.py @@ -116,7 +116,7 @@ def get_game_install_dir(dir_path, target_app_id): # acfファイルにある"installdir" "xxxx"をさがす install_dir_pattern = re.compile(r'\s*"installdir"\s+"(.*)') game_install_dir_name = None - with open(target_app_acf_path, mode='r', encoding="utf8") as target_app_acf_file: + with open(target_app_acf_path, mode='r', encoding="utf8", errors='ignore') as target_app_acf_file: for line in target_app_acf_file: result = install_dir_pattern.match(line) if result is not None: @@ -144,7 +144,7 @@ def get_lib_folders_from_vdf(steam_apps_path): # vdfファイルにある"[数字]" "xxxx"をさがす install_dir_pattern = re.compile(r'\s*"[0-9]+"\s+"(.*)') game_libs_paths = [] - with open(library_folders_vdf_path, mode='r', encoding="utf8") as target_vdf_file: + with open(library_folders_vdf_path, mode='r', encoding="utf8", errors='ignore') as target_vdf_file: for line in target_vdf_file: result = install_dir_pattern.match(line) if result is not None: @@ -154,7 +154,7 @@ def get_lib_folders_from_vdf(steam_apps_path): def install_key_file(save_file_path, mod_title, key_file_path): - with open(save_file_path, encoding="utf-8", mode='w') as fw: + with open(save_file_path, encoding="utf-8", mode='w', errors='ignore') as fw: fw.write("\n".join([ mod_title, key_file_path diff --git a/github_tool.py b/github_tool.py index 7a99c01..2d80383 100644 --- a/github_tool.py +++ b/github_tool.py @@ -46,7 +46,7 @@ def download_asset_from_github(repository_author, req = urllib.request.Request(request_url) - with open(out_file_path, "wb") as my_file: + with open(out_file_path, "wb", errors='ignore') as my_file: my_file.write(urllib.request.urlopen(req).read()) return out_file_path