Skip to content

Commit 26447e2

Browse files
committed
README snippet check: give a mis-encoded source the same one-line error as a missing one
1 parent 17aed5d commit 26447e2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/update_readme_snippets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def process_snippet_block(match: re.Match[str], check_mode: bool = False) -> str
8080

8181
return replacement
8282

83-
except OSError as e:
83+
except (OSError, UnicodeDecodeError) as e:
8484
# Fatal, not "warn and keep the stale block": that would let --check pass with exit 0.
8585
sys.exit(f"Error processing {file_path}: {e}")
8686

0 commit comments

Comments
 (0)