[issue1208304] urllib2's urlopen() method causes a memory leak

Toshio Kuratomi report at bugs.python.org
Mon Nov 24 06:20:17 CET 2008


Toshio Kuratomi <a.badger at gmail.com> added the comment:

I tried to repeat the test in http://bugs.python.org/msg60749 and found
that the descriptors will close if you read from the file before closing.

so this leads to open descriptors::

  import urllib2
  f = urllib2.urlopen('http://www.google.com')
  f.close()

while this does not::

  import urllib2
  f = urllib2.urlopen('http://www.google.com')
  f.read(1)
  f.close()

----------
nosy: +a.badger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1208304>
_______________________________________


More information about the Python-bugs-list mailing list