Martin Panter added the comment: How is it safer to manually set “h.sock._closed”? Playing with the internals of HTTPConnection is one thing, but playing with the internals of the socket object as well does not seem necessary.
Also the ResourceWarning is warning that the socket and connection were closed by the garbage collector at some arbitrary point. I don’t think a new __del__() method is going to help. Sorry to be so negative :) Related issues: Issue 18144: FD leak in urllib2 (probably an exact dupe) Issue 11563: test_urllibnet is triggering a ResourceWarning (bug closed, but real issue was only side-stepped IMO) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19524> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com