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.
This commit is contained in:
Skilly
2026-09-06 16:02:30 +02:00
parent 14f2309688
commit 61647d7511

View File

@@ -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