Say could not read when the trust file is not an object whose projects maps paths to objects #66

Merged
lilleman merged 4 commits from trust-file-shape into main 2026-09-26 15:17:49 +02:00
Showing only changes of commit c40c2d5ffa - Show all commits
+1 -1
View File
@@ -416,7 +416,7 @@ def trust(paths):
print(f"could not read {config}: {getattr(failure, 'strerror', failure)}", file=sys.stderr)
return
projects = data.setdefault("projects", {}) if isinstance(data, dict) else None
if not isinstance(projects, dict) or any(not isinstance(entry, dict) for entry in projects.values()):
if not isinstance(projects, dict) or not all(isinstance(record, dict) for record in projects.values()):
print(f"could not read {config}: not an object whose projects maps paths to objects", file=sys.stderr)
return
granted = [path for path in paths if not projects.get(path, {}).get("hasTrustDialogAccepted")]