Den lör 26 juli 2025 kl 07:22 skrev Yasuhito FUTATSUKI < futat...@yf.bsdclub.org>:
> Hello, > > On 2025/07/25 22:36, Joe Orton wrote: > > On Fri, Jul 25, 2025 at 12:37:56AM +0900, Yasuhito FUTATSUKI wrote: > >> Thank you for testing. > >> > >> The intention of those tests are detection of extra reference > >> remaining after calling callback functions. However, with deferred > >> reference counting and biased reference counting, it cannot work > >> as I(we?) expected. So I don't think the changes on r1926575 is > >> correct if no one cannot explain why this part of the test could > >> pass without modifying expected refcount. > >> > >> I propose: > >> > >> * Use weakref for the tests of this purpose > >> * Until those test is rewrited with using weakref, simply skip > >> them on Python >= 3.14. > > > > Thanks for looking at this, that seems reasonable to me. The attached > > reverts r1926575 and adds skipIf decorators, does it look correct? I'll > > run it through a build too. > > The patch looks good. Also, I've run check-swig-py on Python 3.11 and > it did not skip those tests as we expected. > > Thanks, > -- > Yasuhito FUTATSUKI <futat...@yf.bsdclub.org> > > Hi, I'm not very fond of the idea of just disabling the tests under 3.14, chances are we'll never come to re-writing to weakrefs and then we've basically lost a test. @Yasuhito FUTATSUKI <futat...@yf.bsdclub.org> Do I understand it correctly that you are concerned why we can keep the existing expected count ... 434: for baton in editor.batons: 435: self.assertEqual(sys.getrefcount(baton[2]), 2, ^ HERE 436: "leak on baton %s after replay without errors" 437: % repr(baton)) 438: del e_baton ... but we have to modify it ... 439: self.assertEqual(sys.getrefcount(e_ptr), expected, ^ HERE 440: "leak on editor baton after replay without errors") Can you outline your idea for using weakrefs? Cheers, Daniel