Fix issue #16270: urllib may hang when used for retrieving files via FTP by using a context manager.

This commit is contained in:
Giampaolo Rodola' 2012-10-19 13:40:28 +02:00
parent 91044799f7
commit 2d51f687e1
2 changed files with 3 additions and 6 deletions

View File

@ -2212,13 +2212,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

View File

@ -129,6 +129,9 @@ Core and Builtins
Library
-------
- Issue #16270: urllib may hang when used for retrieving files via FTP by using
a context manager. Patch by Giampaolo Rodola'.
- Issue #16176: Properly identify Windows 8 via platform.platform()
- Issue #16114: The subprocess module no longer provides a misleading