Open petersteneteg opened 2 years ago
Thanks for the test case! TBH, I was afraid something like this could happen, although it's time-consuming to anticipate all edge cases. The test case is super useful. Tagging @wangxf123456, we will look into a fix.
Hi Peter, FYI, I just merged #4612
It passes testing with your reproducers from #3788 and #3801, but please let us know if you believe #4612 causes different new issues on your end.
Required prerequisites
Problem description
Hi, I've found an other issue related to #3788 this is in regard to the smart holder branch
The example code below fails with infinite recursive getattr calls.
removing either
Base2
,Derived2
or the binding of__getattr__
removes the problem.removing the following lines https://github.com/pybind/pybind11/blob/9d4b4dffce6677a7c9a9af37a45f4436d353f5e1/include/pybind11/detail/smart_holder_type_casters.h#L295-L297 also removes the issue.
Reproducible example code