Message 58396 - Python tracker
Ah, I see what's going on. The revision of the socket code (nice job, by the way) removed the distinction between the C socket object and the Python socket object. The C SSLContext keeps a pointer to the C socket object, which is now the Python socket object, or in the SSL case, the SSLSocket object. So there's a circular reference. The right fix is to make the ref in the SSL C code a weakref.