Bohdan Vlasyuk [EMAIL PROTECTED] added the comment:
The list is not the problem. The problem is the other reference, from
socket._fileobject object at 0xf7d42c34.
Also note that the workaround (u.fp.recv = None) removes the second
reference.
This is fine (at least in CPython), because
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 GC is disabled or doesn't