[Python-checkins] cpython (2.7): Fix the urllib closing issue which hangs on particular ftp urls/ftp servers.

senthil.kumaran python-checkins at python.org
Thu Mar 15 21:28:47 CET 2012


http://hg.python.org/cpython/rev/6ce4868861ba
changeset:   75710:6ce4868861ba
branch:      2.7
parent:      75703:c4e0dfbc9f48
user:        Senthil Kumaran <senthil at uthcode.com>
date:        Thu Mar 15 13:24:40 2012 -0700
summary:
  Fix the urllib closing issue which hangs on particular ftp urls/ftp servers. closes issue11199

files:
  Lib/urllib.py |  2 +-
  Misc/NEWS     |  2 ++
  2 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Lib/urllib.py b/Lib/urllib.py
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -980,11 +980,11 @@
         self.hookargs = hookargs
 
     def close(self):
-        addbase.close(self)
         if self.closehook:
             self.closehook(*self.hookargs)
             self.closehook = None
             self.hookargs = None
+        addbase.close(self)
 
 class addinfo(addbase):
     """class to add an info() method to an open file."""
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -20,6 +20,8 @@
 Library
 -------
 
+- Issue #11199: Fix the with urllib which hangs on particular ftp urls.
+
 - Issue #5219: Prevent event handler cascade in IDLE.
 
 - Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list