From: Serhiy Storchaka Date: Sun, 1 Feb 2015 17:01:10 +0000 (+0200) Subject: Don't seek to the start of the file when open ZipFile with the 'w' mode X-Git-Tag: v3.5.0a1~62 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b90f5de26fc6a659e8bb2224c31af89c0b71d0b;p=thirdparty%2FPython%2Fcpython.git Don't seek to the start of the file when open ZipFile with the 'w' mode (regression introduced in issue #14099). --- diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 845c6a96fc61..8c2950f53331 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -1002,7 +1002,7 @@ class ZipFile: # set the modified flag so central directory gets written # even if no files are added to the archive self._didModify = True - self.start_dir = 0 + self.start_dir = self.fp.tell() elif mode == 'a': try: # See if file is a zip file