[issue3066] FD leak in urllib2

2008-06-12 Thread Bohdan Vlasyuk
Bohdan Vlasyuk <[EMAIL PROTECTED]> added the comment: The list is not the problem. The problem is the other reference, from "". Also note that the workaround (u.fp.recv = None) removes the second reference. This is fine (at least in CPython), because the socket is destroyed w

[issue3066] FD leak in urllib2

2008-06-09 Thread Bohdan Vlasyuk
New submission from Bohdan Vlasyuk <[EMAIL PROTECTED]>: In urllib2.AbstractHTTPHandler.do_open, the following like creates a circular link: r.recv = r.read [r.read is a bound method, so it contains a reference to 'r'. Therefore, r now refers to itself.] If the G