Index: Lib/urllib/request.py =================================================================== --- Lib/urllib/request.py (révision 88452) +++ Lib/urllib/request.py (copie de travail) @@ -2154,7 +2154,8 @@ conn = self.ftp.ntransfercmd(cmd) self.busy = 1 # Pass back both a suitably decorated object and a retrieval length - return (addclosehook(conn[0].makefile('rb'), self.endtransfer), conn[1]) + return (conn[0].makefile('rb'), conn[1]) + def endtransfer(self): if not self.busy: return @@ -2165,7 +2166,6 @@ pass def close(self): - self.endtransfer() try: self.ftp.close() except ftperrors(): Index: Lib/urllib/response.py =================================================================== --- Lib/urllib/response.py (révision 88452) +++ Lib/urllib/response.py (copie de travail) @@ -57,11 +57,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."""