Re: [Python-Dev] Avoiding reference leaks in heap types with custom tp_dealloc

2015-06-02 Thread Petr Viktorin
On Mon, Jun 1, 2015 at 6:00 PM, Antoine Pitrou solip...@pitrou.net wrote: [...] I think we have been laxist with additions to the stable ABI: apparently, they should be conditioned on the API version requested by the user. For example, in pystate.h: #if !defined(Py_LIMITED_API) ||

Re: [Python-Dev] Avoiding reference leaks in heap types with custom tp_dealloc

2015-06-02 Thread Antoine Pitrou
On Tue, 2 Jun 2015 21:09:52 +0200 Petr Viktorin encu...@gmail.com wrote: On Mon, Jun 1, 2015 at 6:00 PM, Antoine Pitrou solip...@pitrou.net wrote: [...] I think we have been laxist with additions to the stable ABI: apparently, they should be conditioned on the API version requested by the

Re: [Python-Dev] Avoiding reference leaks in heap types with custom tp_dealloc

2015-06-01 Thread Antoine Pitrou
On Mon, 1 Jun 2015 17:52:13 +0200 Petr Viktorin encu...@gmail.com wrote: On Mon, Jun 1, 2015 at 5:33 PM, Antoine Pitrou solip...@pitrou.net wrote: On Mon, 1 Jun 2015 16:38:35 +0200 Petr Viktorin encu...@gmail.com wrote: [...] The nice way out would be taking advantage of PEP 442:

Re: [Python-Dev] Avoiding reference leaks in heap types with custom tp_dealloc

2015-06-01 Thread Benjamin Peterson
On Mon, Jun 1, 2015, at 11:33, Antoine Pitrou wrote: On Mon, 1 Jun 2015 16:38:35 +0200 Petr Viktorin encu...@gmail.com wrote: Hello, The new test_importlib.extension.test_loader is currently leaking references, (issue24268). There is a simple hack to stop this, but I'm inclined to not

Re: [Python-Dev] Avoiding reference leaks in heap types with custom tp_dealloc

2015-06-01 Thread Petr Viktorin
On Mon, Jun 1, 2015 at 5:33 PM, Antoine Pitrou solip...@pitrou.net wrote: On Mon, 1 Jun 2015 16:38:35 +0200 Petr Viktorin encu...@gmail.com wrote: [...] The nice way out would be taking advantage of PEP 442: xxlimited.Xxo can ditch tp_dealloc in favor of tp_traverse and tp_finalize (the

Re: [Python-Dev] Avoiding reference leaks in heap types with custom tp_dealloc

2015-06-01 Thread Antoine Pitrou
On Mon, 1 Jun 2015 16:38:35 +0200 Petr Viktorin encu...@gmail.com wrote: Hello, The new test_importlib.extension.test_loader is currently leaking references, (issue24268). There is a simple hack to stop this, but I'm inclined to not apply quick hacks and rather dig into the root cause. (It's

Re: [Python-Dev] Avoiding reference leaks in heap types with custom tp_dealloc

2015-06-01 Thread Antoine Pitrou
On Mon, 01 Jun 2015 12:09:37 -0400 Benjamin Peterson benja...@python.org wrote: I thought all the slots were supposed to be available through the stable ABI, since you need them to properly define c types. You're right, I was thinking specifically about the ABI versioning issues (which I