Raising a string causes TypeError instead of intended validation error#616
Closed
huyhoang171106 wants to merge 1 commit intooffa:masterfrom
Closed
Conversation
…ation error Signed-off-by: Nguyen Huy Hoang <181364121+huyhoang171106@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes a Python 3 incompatibility in ensure_sorted.py so malformed app entries raise a proper exception type (instead of crashing with a TypeError), improving CI failure signaling when README app lines are invalid.
Changes:
- Replaces an invalid
raise "..."with aValueError. - Improves the validation error message to include the match count and the offending line.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Author
Auto-closed: CI checks failedThe following checks failed: Cleanup artifacts Closing this PR since required CI checks did not pass. Sorry for the inconvenience. |
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
In Python 3,
raise "..."is invalid because exceptions must derive fromBaseException. When a malformed app entry is encountered (len(matches) != 1), this path crashes withTypeError: exceptions must derive from BaseException, masking the real input problem and breaking the CI check.Files changed
ensure_sorted.py(modified)Testing
Closes #615