Skip to content

Workaround for #2682 and #2422 by simply clearing the TypeError #2685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2020

Conversation

bstaletic
Copy link
Collaborator

Description

As proposed in #2422 (comment), this PR is a possible solution for the assertion error in cpython debug mode.

Fixes #2682
Fixes #2422

Suggested changelog entry:

Fixed assertion error related to unhandled (later overwritten) exception in CPython 3.8 and 3.9 debug builds"

Copy link
Collaborator

@YannickJadoul YannickJadoul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be a safer, more localized workaround than #2684, until we have a full fix for #2336 (which needs a little survey, to see in which places the casts are expected to return a nullptr handle and in which cases an exception is expected, given that it's such a central part of pybind11).

@albanD
Copy link
Contributor

albanD commented Nov 20, 2020

Thanks for the quick fix!

@YannickJadoul
Copy link
Collaborator

@albanD, so this also solves your problem, in combination with #2683?

@YannickJadoul YannickJadoul added this to the v2.6.2 milestone Nov 20, 2020
@albanD
Copy link
Contributor

albanD commented Nov 20, 2020

Yes I can confirm that with the two fixes, the CI for debug cpython 3.8 and 3.9 now run without crashing.
Also 2.7 and 3.6 were not crashing before and are still working fine with the two fixes added.

@YannickJadoul
Copy link
Collaborator

Relevant links (except for just the three related issues #2682, #2422, and #2336):

Note that there should be little to no danger not noticing this patch when #2336 will get patched (we have many tests that get triggered by changes that would fix #2336; see #2336 (comment)).

Copy link
Collaborator

@henryiii henryiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is safe for now.

@EricCousineau-TRI
Copy link
Collaborator

FWIW Ran into a similar issue in our fork, but a slightly different edge case (Eigen::AutoDiffScalar using dtype=object stuff):
RobotLocomotion#52

Just copied this solution there 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants