Say could not read when the trust file is not an object whose projects maps paths to objects
This commit is contained in:
+4
-1
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user