From: Guido van Rossum Date: Sat, 14 Apr 2001 16:45:14 +0000 (+0000) Subject: Mark Favas points out that there's an 'self.fp.flush()' call in the X-Git-Tag: v2.1c2~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f85af612f8c109f52333ee2d106b0848bf6ab372;p=thirdparty%2FPython%2Fcpython.git Mark Favas points out that there's an 'self.fp.flush()' call in the ZipFile.close() method that should be part of the preceding 'if' block. On some platforms (Mark noticed this on FreeBSD 4.2) doing a flush() on a file open for reading is not allowed. --- diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 6a7641f5b53e..74095e250921 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -468,7 +468,7 @@ class ZipFile: endrec = struct.pack(structEndArchive, stringEndArchive, 0, 0, count, count, pos2 - pos1, pos1, 0) self.fp.write(endrec) - self.fp.flush() + self.fp.flush() if not self._filePassed: self.fp.close() self.fp = None