[pypy-issue] [issue867] urllib2 on pypy can leak fd's

Amaury Forgeot d Arc tracker at bugs.pypy.org
Tue Jun 4 20:43:18 CEST 2013

Amaury Forgeot d Arc <amauryfa at gmail.com> added the comment:

This issue should be reported to CPython as well: in python3 sockets are supposed to be careful to not rely on reference counting, 
yet when I run your script with "python3 -Wall" I see the warning:

/usr/lib/python3.2/socket.py:339: ResourceWarning: unclosed <socket.socket object, fd=3, family=2, type=1, proto=6>
  self._sock = None

And as expected, with PyPy a gc.collect() closes the socket.

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list