Skip to content

Commit a7c0cc0

Browse files
authored
fix: ignore badly coded user-provided html of older documents (ietf-tools#4845)
1 parent 81b8ffc commit a7c0cc0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ietf/doc/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def html_body(self, classes=""):
550550
html = Path(
551551
os.path.join(settings.RFC_PATH, self.canonical_name() + ".html")
552552
).read_text()
553-
except IOError:
553+
except (IOError, UnicodeDecodeError):
554554
return None
555555
else:
556556
try:
@@ -560,7 +560,7 @@ def html_body(self, classes=""):
560560
self.name + "-" + self.rev + ".html",
561561
)
562562
).read_text()
563-
except IOError:
563+
except (IOError, UnicodeDecodeError):
564564
return None
565565

566566
# If HTML was generated by rfc2html, do not return it. Caller

0 commit comments

Comments
 (0)