Message207093
| Author |
kristjan.jonsson |
| Recipients |
amaury.forgeotdarc, dstanek, kristjan.jonsson, martin.panter, orsenthil, pitrou, serhiy.storchaka |
| Date |
2013年12月30日.11:29:51 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1388402992.45.0.020437243186.issue7464@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|