Repository navigation
fix(tools): report invalid UTF-8 case source paths - #961
Merged
Merged
Conversation
Translate case-source decoding failures to CaseManifestError with a relative path. Exercise invalid comment/body bytes, valid Unicode, and the existing validate exit-code-2 error contract without a traceback. Fixes wavefnd#941 Signed-off-by: hiyouwhatsapp <[email protected]>
LunaStev
approved these changes
Oct 19, 2026
LunaStev
left a comment
Member
There was a problem hiding this comment.
Reviewed the targeted UTF-8 decode exception handling, path-aware diagnostic, and CLI exit-code regression tests. CI passes.
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.
Fixes #941.
The case manifest's source-metadata scanner uses
Path.read_text(encoding="utf-8"). It currently suppresses OSError for inaccessible source files, but a malformed UTF-8 source raisesUnicodeDecodeErrorthat escapesCaseManifestErrorand produces a traceback.This catches only
UnicodeDecodeErrorat the source read, rethrowing it as a path-awareCaseManifestErrorwith the original decode error as its cause. The existing OSError behavior and valid UTF-8 scanning are unchanged.Coverage
validateCLI's diagnostic/exit-code-2 behavior without a traceback.Verification
UnicodeDecodeErrorwith the old helper; both passed after the fix; the valid UTF-8 control also passed.tools.test_case_manifestsuite could not run locally because a full Wave checkout is unavailable here; CI verification remains necessary.