<p dir="ltr"><br>
On 23 Jul 2014 07:28, "Antoine Pitrou" <<a href="mailto:antoine@python.org">antoine@python.org</a>> wrote:<br>
><br>
> Le 22/07/2014 17:03, Alex Gaynor a écrit :<br>
><br>
>><br>
>> The question is:<br>
>><br>
>> a) Should we backport weak referencing _socket.sockets (changing the structure<br>
>>     of the module seems overly invasive, albeit completely backwards<br>
>>     compatible)?<br>
>> b) Does anyone know why weak references are used in the first place? The commit<br>
>>     message just alludes to fixing a leak with no reference to an issue.<br>
><br>
><br>
> Because :<br>
> - the SSLSocket has a strong reference to the ssl object (self._sslobj)<br>
> - self._sslobj having a strong reference to the SSLSocket would mean both would only get destroyed on a GC collection<br>
><br>
> I assume that's what "leak" means here :-)<br>
><br>
> As for 2.x, I don't see why you couldn't just continue using a strong reference.</p>
<p dir="ltr">As Antoine says, if the cycle already exists in Python 2 (and it sounds like it does), we can just skip backporting the weak reference change.</p>
<p dir="ltr">I'll also give the Fedora Python list a heads up about your repo to see if anyone there can help you with the backport.</p>
<p dir="ltr">Cheers,<br>
Nick.<br></p>
<p dir="ltr">><br>
> Regards<br>
><br>
> Antoine.<br>
><br>
><br>
><br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com">https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com</a><br>
</p>