From 7c5b02d769516d8d36bc805d21471789cf7b8b97 Mon Sep 17 00:00:00 2001 From: AchieverSana Date: Mon, 7 Sep 2026 12:49:23 +0000 Subject: [PATCH] fix: render_terminal_png.py fails cleanly on missing input file Wrap the input file read in a try/except FileNotFoundError and print an 'error: not found' message with exit code 2, matching the existing usage-error style, instead of leaking a raw traceback. Closes #460 --- scripts/render_terminal_png.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/render_terminal_png.py b/scripts/render_terminal_png.py index 0fc15f5..2d4763c 100644 --- a/scripts/render_terminal_png.py +++ b/scripts/render_terminal_png.py @@ -67,7 +67,11 @@ def main(): if len(sys.argv) != 3: print(f"usage: {sys.argv[0]} ", file=sys.stderr) raise SystemExit(2) - text = Path(sys.argv[1]).read_text() + try: + text = Path(sys.argv[1]).read_text() + except FileNotFoundError: + print(f"error: {sys.argv[1]} not found", file=sys.stderr) + raise SystemExit(2) render(text, sys.argv[2])