BUG: #31993: Return FAIL if PyArray_ClipmodeConverter is called with an invalid integer value.#31996
Open
stestagg wants to merge 1 commit into
Open
BUG: #31993: Return FAIL if PyArray_ClipmodeConverter is called with an invalid integer value.#31996stestagg wants to merge 1 commit into
stestagg wants to merge 1 commit into
Conversation
…with an invalid integer value. PyArray_ClipmodeConverter sets the exception if an invalid value is passed, but for numbers, returned NPY_SUCCEED. Python in debug mode catches this and aserts/aborts, returning NPY_FAIL correctly propagates the exception at the right point. Before this change, the new test caused spin to silently fail with exit code 250. With the change tests pass as expected.
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.
PR summary
PyArray_ClipmodeConverter sets the exception if an invalid value is passed but, for numbers, also returned NPY_SUCCEED.
Python in debug mode catches this and aserts/aborts.
Returning NPY_FAIL correctly propagates the exception at the right point.
Before this change, the new test caused
spin testtosilently fail with exit code 250.
Test output tail
With the change tests pass as expected.
First time committer introduction
Hi 👋, I've been using numpy since about 2009 maybe, I'm getting to the point where I can do some fuzz testing of
pandason things like json/csv, parquet etc, but along the way, I was checking that numpy would work, and stumbled across this really niche issue, but the fix is so tiny/self-evident I thought I'd get it in.AI Disclosure
Codex was used in helping identify/debug the initial root cause of the debug abort.
No AI tools were used in the actual development of this PR
Fixed: #31993