From 02b437069559ba980b5ddf9454b677112ee77e6f Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Wed, 19 Aug 2026 16:16:39 +0100 Subject: [PATCH] Fix link checker crash: loop variable shadowed the html module The DOI validation step iterates site pages with `for html in SITE_ROOT.rglob(...)`, which rebinds the imported `html` module to a Path, so `html.unescape(...)` raises AttributeError and the job fails. Rename the loop variable to `page_file`. Co-Authored-By: Claude Opus 5 --- .github/workflows/link-check.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/link-check.yaml b/.github/workflows/link-check.yaml index 1f1c2c720d2..c2519f525d8 100644 --- a/.github/workflows/link-check.yaml +++ b/.github/workflows/link-check.yaml @@ -348,13 +348,13 @@ jobs: # doi -> set of source pages doi_pages = defaultdict(set) - for html in SITE_ROOT.rglob("*.html"): + for page_file in SITE_ROOT.rglob("*.html"): try: - text = html.read_text(errors="ignore") + text = page_file.read_text(errors="ignore") except Exception: continue # Strip the artifact-name dir (/tmp/site//) -> / - rel_parts = html.relative_to(SITE_ROOT).parts[1:] + rel_parts = page_file.relative_to(SITE_ROOT).parts[1:] page = "/" + "/".join(rel_parts) page = re.sub(r"/index\.html$", "/", page) for m in DOI_RE.finditer(text):