Uh oh!
There was an error while loading. Please reload this page.
bugfix: py contains raises errors when appropiate - #4209
Conversation
rwgk
commented
Oct 3, 2022
Will do. |
rwgk
commented
Oct 3, 2022
Hi @mattip, PyPy doesn't seem to raise |
mattip
commented
Oct 3, 2022
If I understand correctly, |
rwgk
commented
Oct 4, 2022
Thanks @mattip! I downloaded and unpacked the "log archive" here, then: AFAICT it only fails for @Skylion007 does my understanding look right to you? |
mattip
commented
Oct 4, 2022
Right, I can reproduce with a nightly pypy in a repo that runs CI on popular C extensions. I will try to fix it there. |
rwgk
commented
Oct 4, 2022
I don't see any problems in the global testing results related to this PR. Very minor caveat: results are unusually noisy this morning, but I looked pretty carefully. |
mattip
commented
Oct 6, 2022
There is a corner case for empty sets where PyPy does not raise. CPython2 and CPython3 raise. See https://foss.heptapod.net/pypy/pypy/-/issues/3824 |
Uh oh!
There was an error while loading. Please reload this page.
| bool object_api<D>::contains(T &&item) const { | ||
| return attr("__contains__")(std::forward<T>(item)).template cast<bool>(); | ||
| auto ret = attr("__contains__")(std::forward<T>(item)).template cast<bool>(); | ||
| if (PyErr_Occurred()) { |
There was a problem hiding this comment.
Can this actually happen?
I was thinking the line before will either succeed or there will be an exception (error_already_set, cast_error) in flight already.
There was a problem hiding this comment.
@rwgk Good catch, my test designed to test this pathway fired fine without the if statement locally.
rwgk
left a comment
There was a problem hiding this comment.
Thanks Aaron for plugging these holes, and the new tests!
CentOS7 / PGI 22.3 appears to be generally broken (same failure in another PR) and the other failing test is a notorious flake. I think it's best if we ignore the CentoOS failure, merge our PRs, then one of us can look what's going on with CentOS. |
294f720 to
129c6cfComparerwgk
commented
Oct 13, 2022
@Skylion007 I just rebased this on master, to trigger the CI, to see if the CentOS7 / PGI 22.3 problem was fixed in the meantime. |
@henryiii@ax3l Do you know what's behind the error below? First observed yesterday, still failing now. https://github.com/pybind/pybind11/actions/runs/3244896869/jobs/5321695298 |
rwgk
commented
Oct 17, 2022
Hi @Skylion007, is there a chance that you could merge this today? (Asking b/o I'm hoping to include this in the next smart_holder update.) |
Skylion007
commented
Oct 17, 2022
@rwgk Wasn't sure if wanted to wait until the next major update as this is a bit of a behavior change. |
Skylion007
commented
Oct 17, 2022
If we are good with it, feel free to merge it. |
rwgk
commented
Oct 17, 2022
Do you want this in 2.10.1? It looks more like a bug-fix-behavior-change than a feature-behavior-change to me. |
henryiii
left a comment
There was a problem hiding this comment.
Yes, I’d say this is a bug fix.
rwgk
commented
Oct 17, 2022
Thanks! |
Only concern is that set.add() is still broken, and we sort of rely on that broken behavior in the caster. So that's a bigger PR issue I haven't looked at. |
rwgk
commented
Oct 17, 2022
Sorry, looks like I was a bit fast.
Leaving that for later sounds like the right move, does that make sense? |
Description
Suggested changelog entry: