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

This commit is contained in:
2026-09-26 15:13:18 +02:00
parent df2b010fee
commit fe1a0f03ca
2 changed files with 4 additions and 2 deletions
+4 -1
View File
@@ -415,7 +415,10 @@ def trust(paths):
except (OSError, ValueError) as failure:
print(f"could not read {config}: {getattr(failure, 'strerror', failure)}", file=sys.stderr)
return
projects = data.setdefault("projects", {})
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()):
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")]
if not granted:
return
-1
View File
@@ -4,5 +4,4 @@
Ordered by how many seats of the 2026-09-25 scoring panel (`docs/decisions.md`) named the place; each is one chunk.
- Say `could not read` when `~/.claude.json` parses to anything but an object whose `projects` maps paths to objects, today a traceback before the interrupt.
- State in `docs/decisions.md` the oldest Python `bin/` must parse on, today unstated and 3.11 by the last review.