Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion zulint/custom_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ def custom_check_file(
failed = False

with open(fn, encoding="utf8") as f:
contents = f.read()
try:
contents = f.read()
except UnicodeDecodeError as e:
print(f"unable to process file {fn} due to unicode decode error")
print(e)
return True
line_starts = [m.start() for m in re.finditer(r"^.", contents, re.M | re.S)]

rules_to_apply = self.get_rules_applying_to_fn(fn=fn, rules=self.rules)
Expand Down