Message207093
No, the socket is actually closed when response's close() method is called. The problem is that the HTTPResponse object, buried deep within the nested classes returned from do_open(), has a circular reference, and _it_ will not go away.
No one is _relying_ on garbage collection in the sense that this is not, I think, designed behaviour, merely an unintentional effect of storing a bound method in the object inance.
As always, circular reference should be avoided when possible since relying on gc is not something to be done lightly.
Now, I think that changing the complicated wrapping at this stage is not possible, but merely replacing the bound method with a weak method might just do the trick. |
|
Date |
User |
Action |
Args |
2013-12-30 11:29:52 | kristjan.jonsson | set | recipients:
+ kristjan.jonsson, amaury.forgeotdarc, orsenthil, pitrou, dstanek, martin.panter, serhiy.storchaka |
2013-12-30 11:29:52 | kristjan.jonsson | set | messageid: <1388402992.45.0.020437243186.issue7464@psf.upfronthosting.co.za> |
2013-12-30 11:29:52 | kristjan.jonsson | link | issue7464 messages |
2013-12-30 11:29:51 | kristjan.jonsson | create | |
|