From 1c693c0263a2854512cd8520e8ae70b1144198dd Mon Sep 17 00:00:00 2001 From: DominikDoom Date: Sun, 17 Sep 2023 15:28:34 +0200 Subject: [PATCH] Catch UnicodeDecodeError to prevent corrupted yaml files from breaking the extension As mentioned in #240 --- scripts/tag_autocomplete_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/tag_autocomplete_helper.py b/scripts/tag_autocomplete_helper.py index f95aa85..eff5f59 100644 --- a/scripts/tag_autocomplete_helper.py +++ b/scripts/tag_autocomplete_helper.py @@ -96,8 +96,8 @@ def get_yaml_wildcards(): parse_dynamic_prompt_format(yaml_wildcards, data, path) else: print('No data found in ' + path.name) - except yaml.YAMLError: - print('Issue in parsing YAML file ' + path.name) + except (yaml.YAMLError, UnicodeDecodeError) as e: + print(f'Issue in parsing YAML file {path.name}: {e}') continue # Sort by count