Exit with a message when README.md is not UTF-8

This commit is contained in:
2026-09-26 14:59:30 +02:00
parent 9af9745b7a
commit 825872acc2
4 changed files with 5 additions and 2 deletions
+2
View File
@@ -165,6 +165,8 @@ def read_premises(root):
found = sections(open(os.path.join(root, "README.md"), encoding="utf-8").read())
except OSError as failure:
sys.exit(f"README.md in {root}: {failure.strerror} - no premises.")
except UnicodeDecodeError as failure:
sys.exit(f"README.md is not UTF-8 at byte {failure.start} - no premises.")
for name in ("Goals", "Audience"):
bodies = found.get(name, [])
if not bodies: