]> granicus.if.org Git - python/commitdiff
Fix issue #16270: urllib may hang when used for retrieving files via FTP by using...
authorGiampaolo Rodola' <g.rodola@gmail.com>
Fri, 19 Oct 2012 11:40:28 +0000 (13:40 +0200)
committerGiampaolo Rodola' <g.rodola@gmail.com>
Fri, 19 Oct 2012 11:40:28 +0000 (13:40 +0200)
Lib/urllib/request.py
Misc/NEWS

index d6f9f9a1bcaa8efc186d9499da9fb781eed84068..64092cf7d6c17d76c43f58d84bbb2b4aeed299f2 100644 (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
index 0efbefae70a0ea4229ffec18c3eb46fd72576aee..436a24967f7160c6ac66276bac97a71237026e2f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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