Skip to content

tools/sb3.py crashes with traceback when .sb3 lacks project.json #352

@aspizu

Description

@aspizu

Repro

tmp=$(mktemp -d /tmp/goboscript-sb3-no-project-XXXXXX)
python3 - <<'PY' "$tmp/empty.sb3"
import sys, zipfile
with zipfile.ZipFile(sys.argv[1], 'w'):
    pass
PY
python3 tools/sb3.py --validate "$tmp/empty.sb3"

Observed:

Traceback (most recent call last):
  File "tools/sb3.py", line 51, in <module>
    with zf.open("project.json") as f:
...
KeyError: "There is no item named 'project.json' in the archive"

This also happens with empty .sb3 files left behind by failed compiler runs.

Expected

tools/sb3.py should print a normal error and exit nonzero when project.json is missing, not throw a Python traceback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions