Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions web/pandas_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,16 @@ def main(
For ``.md`` and ``.html`` files, render them with the context
before copying them. ``.md`` files are transformed to HTML.
"""
# Sanity check: validate that versions.json is valid JSON
versions_path = os.path.join(source_path, "versions.json")
with open(versions_path, encoding="utf-8") as f:
try:
json.load(f)
except json.JSONDecodeError as e:
raise RuntimeError(
f"Invalid versions.json: {e}. Ensure it is valid JSON."
) from e

config_fname = os.path.join(source_path, "config.yml")

shutil.rmtree(target_path, ignore_errors=True)
Expand Down