Exit with a message when README.md is not UTF-8
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user