Print the OS error's text once, the way read_premises does

This commit is contained in:
2026-09-25 17:27:09 +02:00
parent 40f0b73a19
commit 159cecaa1f
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -222,7 +222,7 @@ def trust(paths):
with open(config, encoding="utf-8") as handle:
data = json.load(handle)
except (OSError, ValueError) as failure:
print(f"could not read {config}: {failure}", file=sys.stderr)
print(f"could not read {config}: {getattr(failure, 'strerror', failure)}", file=sys.stderr)
return
projects = data.setdefault("projects", {})
granted = [path for path in paths if not projects.get(path, {}).get("hasTrustDialogAccepted")]