From the review of #109.
published("json", ...) calls document.get(selector) before checking the shape. A body that is a bare JSON list raises AttributeError: 'list' object has no attribute 'get', which is not in the except (ValueError, json.JSONDecodeError) clause, so the nightly run dies with a traceback rather than printing an unread line for that Mech. The fallback two lines down — return len(document) if isinstance(document, list) else None — is unreachable for exactly the case its comment describes.
Reproduced on the branch:
>>> check_cards.published("json", "[1,2,3]", "ingredients")
AttributeError: 'list' object has no attribute 'get'
Fix belongs in #109: test the list shape first, and treat any other non-object body as a shape change.
From the review of #109.
published("json", ...)callsdocument.get(selector)before checking the shape. A body that is a bare JSON list raisesAttributeError: 'list' object has no attribute 'get', which is not in theexcept (ValueError, json.JSONDecodeError)clause, so the nightly run dies with a traceback rather than printing anunreadline for that Mech. The fallback two lines down —return len(document) if isinstance(document, list) else None— is unreachable for exactly the case its comment describes.Reproduced on the branch:
Fix belongs in #109: test the list shape first, and treat any other non-object body as a shape change.