From: Giampaolo Rodola' Date: Fri, 19 Oct 2012 11:25:17 +0000 (+0200) Subject: Fix issue #16270: urllib may hang when used for retrieving files via FTP by using... X-Git-Tag: v3.4.0a1~2223 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89e92854b6d2c2d9d385795ea976d97ee2d97e65;p=python Fix issue #16270: urllib may hang when used for retrieving files via FTP by using a context manager. --- diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 67b4c795b3..88f3ce1a26 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 b691c3762a..3ae254faab 100644 --- 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