Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Handle invalid UTF-8 and file-read failures before linting or executing a
.dmaisource file. Invalid encodings now produce a concise Maithili message and dedicated exit code instead of a raw Python traceback.Motivation / Audit Reference
Closes #27.
Test Evidence
pytest -v --cov=maithili_dsl --cov-report=term-missing— 162 passed, 95.00% total coverage;cli.py97%error.dmaifailed as expectedpython -m maithili_dsl --versionreports0.4.0Security Considerations
The file is still read before any linting, transpilation, import validation, or execution. Malformed input now fails closed at that boundary. The generic
OSErrormessage does not expose local path or exception details.Breaking Changes
None. Valid UTF-8 programs retain their existing behavior and exit codes. Invalid encodings now have the documented non-zero
EXIT_BAD_ENCODINGcode instead of an uncaught exception.Checklist