fix(job-key): report a non-string url in --audit instead of a traceback (#634)

* fix(job-key): report a non-string url in --audit instead of a traceback

A numeric, list or object url crashed the duplicate-URL pass with an
AttributeError on .rstrip. Report it with a one-line error naming the key,
as the other malformed-state branches do.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* changelog: place the #634 entry under [Unreleased]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com>
This commit is contained in:
authored and GitHub committed 2026-10-19 19:30:01 +02:00
1 parent 60379dfed4
commit 3c97e7bc93
3 files changed
+17

No files matched your search

+4
View File
@@ -191,6 +191,10 @@ def audit(path: Path) -> int:
if not_objects:
print(f"{path}: entry is not an object: {not_objects[0]}", file=sys.stderr)
return 1
bad_url = [k for k, v in seen.items() if v.get("url") is not None and not isinstance(v["url"], str)]
if bad_url:
print(f"{path}: entry url is not a string: {bad_url[0]}", file=sys.stderr)
return 1
malformed = [k for k in seen if not is_canonical(k) and not is_legacy_shape(k)]
legacy = [k for k in seen if is_legacy_shape(k)]