Skip to content

BUG: PyObject_IsTrue and PyObject_Not error handling in setflags - #24178

Merged
seberg merged 1 commit into
numpy:mainfrom
ngoldbaum:setflags-error-handling
Jul 14, 2023
Merged

seberg merged 1 commit into
numpy:mainfrom
ngoldbaum:setflags-error-handling

Conversation

@ngoldbaum

@ngoldbaum ngoldbaum commented Jul 13, 2023 •

Copy link
Copy Markdown
Member

Fixes an issue revealed by the fuzzing in #24175. If any of the arguments are ndarrays or any other type that raises an error when trying to figure out its truthiness, the interpreter will get into an inconsistent state.

@seberg
seberg merged commit a6a9a9a into numpy:main Jul 14, 2023
@seberg

seberg commented Jul 14, 2023

Copy link
Copy Markdown
Member

Seeing this, can't help but try to clean this up a bit; but lets do that as a follow-up.

@seberg

seberg commented Jul 14, 2023

Copy link
Copy Markdown
Member

Probably need a OptionalBoolConverter to make it nice; which is trivial of course, but...

@charris

charris commented Jul 14, 2023

Copy link
Copy Markdown
Member

Does this need a backport?

@seberg seberg added the 09 - Backport-Candidate PRs tagged should be backported label Jul 14, 2023
@seberg

seberg commented Jul 14, 2023

Copy link
Copy Markdown
Member

Does this need a backport?

Good point, it's a safe bugfix, so sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants