mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Fix issue #16270: urllib may hang when used for retrieving files via FTP by using a context manager.
This commit is contained in:
parent
2ee776bcea
commit
b0cc91290c
2 changed files with 3 additions and 6 deletions
|
@ -2326,13 +2326,7 @@ class ftpwrapper:
|
|||
return (ftpobj, retrlen)
|
||||
|
||||
def endtransfer(self):
|
||||
if not self.busy:
|
||||
return
|
||||
self.busy = 0
|
||||
try:
|
||||
self.ftp.voidresp()
|
||||
except ftperrors():
|
||||
pass
|
||||
|
||||
def close(self):
|
||||
self.keepalive = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue