Explicitly close the socket and temp file in URLopener.retrieve(), so

that multiple retrievals using the same connection will work.

This leaves open the more general problem that after
    f = urlopen("ftp://...")
f must be closed before another retrieval from the same host should be
attempted.
This commit is contained in:
Guido van Rossum 1997-08-26 19:06:40 +00:00
parent 36b8f945e7
commit ab0abdcef8
1 changed files with 2 additions and 0 deletions

View File

@ -191,6 +191,8 @@ class URLopener:
while block:
tfp.write(block)
block = fp.read(bs)
fp.close()
tfp.close()
del fp
del tfp
return result