File: maithili_dsl/cli.py (run_dmai_file)
The file is read outside the try/except, so a .dmai file that is not valid UTF-8 crashes the CLI with a raw Python traceback instead of a friendly Maithili error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
(Verified against v0.3.0 with a UTF-16-encoded file.)
Fix: wrap the read in try/except (UnicodeDecodeError, OSError), print a Maithili error message (see existing style, e.g. ⚠️ त्रुटि: फाइल UTF-8 में नहि अछि।), and return a non-zero exit code (reuse EXIT_NOT_FOUND or add EXIT_BAD_ENCODING = 7 and document it).
Tests: tests/test_cli.py — write a non-UTF8 temp file, assert exit code and no traceback.
Good first issue: small, contained, and a nice tour of the CLI error-handling style.
File:
maithili_dsl/cli.py(run_dmai_file)The file is read outside the try/except, so a
.dmaifile that is not valid UTF-8 crashes the CLI with a raw Python traceback instead of a friendly Maithili error:(Verified against v0.3.0 with a UTF-16-encoded file.)
Fix: wrap the read in try/except
(UnicodeDecodeError, OSError), print a Maithili error message (see existing style, e.g.⚠️ त्रुटि: फाइल UTF-8 में नहि अछि।), and return a non-zero exit code (reuseEXIT_NOT_FOUNDor addEXIT_BAD_ENCODING = 7and document it).Tests:
tests/test_cli.py— write a non-UTF8 temp file, assert exit code and no traceback.Good first issue: small, contained, and a nice tour of the CLI error-handling style.