From: Serhiy Storchaka Date: Sun, 1 Jan 2017 17:04:09 +0000 (+0200) Subject: Issue #29094: Offsets in a ZIP file created with extern file object and modes X-Git-Tag: v2.7.14rc1~310 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f4ed2cdc6e7887153c481f4c7298bc35e219d84;p=python Issue #29094: Offsets in a ZIP file created with extern file object and modes "w" now are relative to the start of the file. --- diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 1d1065083b..cc9f2e69e1 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -772,7 +772,7 @@ class ZipFile(object): # set the modified flag so central directory gets written # even if no files are added to the archive self._didModify = True - self._start_disk = self.fp.tell() + self._start_disk = 0 elif key == 'a': try: # See if file is a zip file diff --git a/Misc/NEWS b/Misc/NEWS index dc33582c3c..2a211ddbc2 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -15,6 +15,9 @@ Core and Builtins Library ------- +- Issue #29094: Offsets in a ZIP file created with extern file object and mode + "w" now are relative to the start of the file. + - Issue #13051: Fixed recursion errors in large or resized curses.textpad.Textbox. Based on patch by Tycho Andersen.