summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiampaolo Rodola' <g.rodola@gmail.com>2012-10-19 11:34:32 (GMT)
committerGiampaolo Rodola' <g.rodola@gmail.com>2012-10-19 11:34:32 (GMT)
commitb0cc91290cfa12621cb51eb0c7d6a0f223722346 (patch)
treee2f1ee4c52da50985d81142658705f4031fcdde3
parent2ee776bcea795f0ef2247be9708251b3485a80a1 (diff)
downloadcpython-b0cc91290cfa12621cb51eb0c7d6a0f223722346.zip
cpython-b0cc91290cfa12621cb51eb0c7d6a0f223722346.tar.gz
cpython-b0cc91290cfa12621cb51eb0c7d6a0f223722346.tar.bz2
Fix issue #16270: urllib may hang when used for retrieving files via FTP by using a context manager.
-rw-r--r--Lib/urllib/request.py6
-rw-r--r--Misc/NEWS3
2 files changed, 3 insertions, 6 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 67b4c79..88f3ce1 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -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
diff --git a/Misc/NEWS b/Misc/NEWS
index 228db08..98c8749 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -43,6 +43,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 error