Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 73277fe

Browse files
committed
closes Issue #11199: Fix the with urllib which hangs on particular ftp urls.
1 parent 38c2754 commit 73277fe

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/urllib/response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ def __init__(self, fp, closehook, *hookargs):
6161
self.hookargs = hookargs
6262

6363
def close(self):
64-
addbase.close(self)
6564
if self.closehook:
6665
self.closehook(*self.hookargs)
6766
self.closehook = None
6867
self.hookargs = None
68+
addbase.close(self)
6969

7070
class addinfo(addbase):
7171
"""class to add an info() method to an open file."""

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Core and Builtins
2222
Library
2323
-------
2424

25+
- Issue #11199: Fix the with urllib which hangs on particular ftp urls.
26+
2527
- Issue #14062: Header objects now correctly respect the 'linesep' setting
2628
when processed by BytesParser (which smtplib.SMTP.send_message uses).
2729

0 commit comments

Comments
 (0)