]> granicus.if.org Git - python/commitdiff
Recorded merge of revisions 76642 via svnmerge from
authorPhilip Jenvey <pjenvey@underboss.org>
Thu, 3 Dec 2009 02:45:01 +0000 (02:45 +0000)
committerPhilip Jenvey <pjenvey@underboss.org>
Thu, 3 Dec 2009 02:45:01 +0000 (02:45 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76642 | philip.jenvey | 2009-12-02 18:40:13 -0800 (Wed, 02 Dec 2009) | 1 line

  actually close files
........

Lib/urllib/request.py

index d669aec54e1f4f15d1ff9916469d6b35d296f6f7..6c7215219cfeee573669cf2a6467ed8f6655b04e 100644 (file)
@@ -1471,7 +1471,7 @@ class URLopener:
             try:
                 fp = self.open_local_file(url1)
                 hdrs = fp.info()
-                del fp
+                fp.close()
                 return url2pathname(splithost(url1)[1]), hdrs
             except IOError as msg:
                 pass
@@ -1515,8 +1515,6 @@ class URLopener:
                 tfp.close()
         finally:
             fp.close()
-        del fp
-        del tfp
 
         # raise exception if actual size does not match content-length header
         if size >= 0 and read < size: