From 61647d7511ccb4a57f3ef028056493030b4b8ea4 Mon Sep 17 00:00:00 2001 From: Skilly Date: Sun, 6 Sep 2026 16:02:30 +0200 Subject: [PATCH] Create the data directory before writing the sheet SheetFetcher.save() opened paths.sheet_html without creating its parent, so a fresh install failed with FileNotFoundError on the first fetch -- Paths only computes locations, and this is usually the first write to the data root. Matches how every other writer in the pipeline behaves. --- src/apworld_tester/pipeline/sheet/fetcher.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/apworld_tester/pipeline/sheet/fetcher.py b/src/apworld_tester/pipeline/sheet/fetcher.py index 037b006..975360a 100644 --- a/src/apworld_tester/pipeline/sheet/fetcher.py +++ b/src/apworld_tester/pipeline/sheet/fetcher.py @@ -51,6 +51,7 @@ class SheetFetcher: def save(self, content=None): """Write the tab's HTML, returning where it landed.""" content = self.fetch() if content is None else content + os.makedirs(os.path.dirname(self.paths.sheet_html), exist_ok=True) with open(self.paths.sheet_html, "wb") as handle: handle.write(content) return self.paths.sheet_html