Handle result from PyObject_VisitManagedDict#6032
Handle result from PyObject_VisitManagedDict#6032maxbachmann wants to merge 3 commits intopybind:masterfrom
Conversation
|
How much trouble is it to add a test? If adding a test is too much trouble: could you please explain in the PR description what the problem was, and why this is the correct fix? I'm totally willing to believe this fix is needed and correct, but without any test or explanation it's very opaque. |
|
This is the same handling as PY_VISIT. I had the same bug in the Python wrapper I am implementing at my company and so checked whether others had this problem as well. For us this fixes the following case: instance = m.DynamicAttr()
instance.a = "test"
assert instance in gc.get_referrers(instance.__dict__)For pybind11 this unit test still fails due to python/cpython#130327. It should presumably work once we upgrade to 3.14.4 which was released yesterday. |
|
Worth noting that cpython doesn't always properly handle the result either (python/cpython#148275). |
|
I was hoping that since 3.14.4 is released in https://github.com/actions/python-versions it would pick it up now, but apparently that isn't the case |
In the past I've seen it taking a day or so. Do you see the option to "rerun failed tests"? (I'll try to look at this PR carefully on the weekend.) |
|
No I don't have that option. |
|
I just clicked the button, but it's still picking up: Successfully set up CPython (3.14.3) Under https://github.com/pybind/pybind11/actions/runs/24187486767/job/70595813802?pr=6032 I see: I think it'll be best if you skip that test for Python versions between 3.14.0 and 3.14.3 (or similar; I'm not sure). |
|
If you need more reruns, tag me here with "another rerun needed" or similar. I cannot focus on this PR before the weekend, but I can do quick button clicks. |
Without this the relationship between
__dict__and self isn't found.