]> 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:25:17 +0000 (13:25 +0200)
committerGiampaolo Rodola' <g.rodola@gmail.com>
Fri, 19 Oct 2012 11:25:17 +0000 (13:25 +0200)
Lib/urllib/request.py
Misc/NEWS

index 67b4c795b36edc3af28d271c9c566f41216c09f9..88f3ce1a26a7ba0441519dbcc3db4744af921865 100644 (file)
@@ -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
index b691c3762a93742aad3452ffa8c3499b20ad77f6..3ae254faabcf95914149e5f2f7625bbbb8625293 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -53,6 +53,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 #16088: BaseHTTPRequestHandler's send_error method includes a