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

Skip to content

Commit 3270d11

Browse files
committed
port from 3.2 - Fix the urllib closing issue which hangs on particular ftp urls/ftp servers. closes issue11199
2 parents 9635013 + 73277fe commit 3270d11

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
@@ -64,11 +64,11 @@ def __init__(self, fp, closehook, *hookargs):
6464
self.hookargs = hookargs
6565

6666
def close(self):
67-
addbase.close(self)
6867
if self.closehook:
6968
self.closehook(*self.hookargs)
7069
self.closehook = None
7170
self.hookargs = None
71+
addbase.close(self)
7272

7373
class addinfo(addbase):
7474
"""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
@@ -24,6 +24,8 @@ Core and Builtins
2424
Library
2525
-------
2626

27+
- Issue #11199: Fix the with urllib which hangs on particular ftp urls.
28+
2729
- Issue #14222: Use the new time.steady() function instead of time.time() for
2830
timeout in queue and threading modules to not be affected of system time
2931
update.

0 commit comments

Comments
 (0)