Index: Lib/urllib.py =================================================================== --- Lib/urllib.py (révision 88505) +++ Lib/urllib.py (copie de travail) @@ -894,8 +894,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 @@ -906,7 +906,6 @@ pass def close(self): - self.endtransfer() try: self.ftp.close() except ftperrors(): @@ -950,11 +949,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."""