Message92245
i also ran into the problem of cyclic dependencies. i know if i would
call gc.collect() the problem would be solved, but calling gc.collect()
takes a long time.
the problem is the cyclic dependency with
r.recv=r.read
i have fixed it localy by wrapping the addinfourl into a new class (i
called it addinfourlFixCyclRef) and overloading the close method, and
within the close method set the recv to none again.
class addinfourlFixCyclRef(addinfourl):
def close(self):
if self.fp is not None and hasattr(self.fp, "_sock"):
self.fp._sock.recv = None
addinfourl.close(self)
....
r.recv = r.read
fp = socket._fileobject(r, close=True)
resp = addinfourlFixCyclRef(fp, r.msg, req.get_full_url())
and when i call .close() from the response it just works. Unluckily i
had to patch even more in case there is an exception called.
For the whole fix see the attachment |
|
Date |
User |
Action |
Args |
2009-09-04 10:17:27 | peci | set | recipients:
+ peci, jhylton, akuchling, holdenweb, jafo, amaury.forgeotdarc, orsenthil, bwelling, stephbul, manekcz, nswinton, a.badger |
2009-09-04 10:17:27 | peci | set | messageid: <1252059447.66.0.222476600136.issue1208304@psf.upfronthosting.co.za> |
2009-09-04 10:17:26 | peci | link | issue1208304 messages |
2009-09-04 10:17:26 | peci | create | |
|