Skip to content

Fix erronous python error setting on failed cast - #2684

Closed
albanD wants to merge 1 commit into
pybind:masterfrom
albanD:fix_cast_err_set
Closed

Fix erronous python error setting on failed cast#2684
albanD wants to merge 1 commit into
pybind:masterfrom
albanD:fix_cast_err_set

Conversation

@albanD

Copy link
Copy Markdown
Contributor

Description

Proposed fix for #2682 if maintainers agree that this is the right thing to do.

Fix crash in test suite for both debug cpython 3.8 and 3.9

Suggested changelog entry:

Not sure how detailed the description below should be. Let me know if this needs updating.

Prevent setting python error twice on failed argument cast

@YannickJadoul

Copy link
Copy Markdown
Collaborator

Cfr. #2682 (comment), this PR is more complex than the proposed workaround in #2422 (#2422 (comment)), but doesn't seem to handle all the subtleties regarding #2336. In order to fix #2682, I propose to stick to @bstaletic's minimal workaround, and fix #2336 after a more thorough investigation of the issue and its consequences.

@albanD

Copy link
Copy Markdown
ContributorAuthor

I do agree that it should be throwing. I opened this PR mostly so that you could see the concrete code I was talking about.
Closing as not the right fix.

@albanDalbanD closed this Nov 20, 2020
@YannickJadoul

Copy link
Copy Markdown
Collaborator

Perfect. Thanks for the effort and investigation! And again apologies that I didn't make the link yesterday evening (evening/night for me, at least) :-)

@albanD

Copy link
Copy Markdown
ContributorAuthor

No worries!

@rwgkrwgk mentioned this pull request Feb 10, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@albanD@YannickJadoul