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:
parent
36b8f945e7
commit
ab0abdcef8
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue