]> granicus.if.org Git - python/commitdiff
Issue #29094: Offsets in a ZIP file created with extern file object and modes
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 1 Jan 2017 17:04:09 +0000 (19:04 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 1 Jan 2017 17:04:09 +0000 (19:04 +0200)
"w" now are relative to the start of the file.

Lib/zipfile.py
Misc/NEWS

index 1d1065083bd51a92e77b72bac7c38cb95a2d01de..cc9f2e69e18846ab1e4d9d54cf5e982e304f1345 100644 (file)
@@ -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
index dc33582c3ca1c618fe1c99be08e464bf4c28a6c5..2a211ddbc2c167b27c83e5127bbdfa81a9b18527 100644 (file)
--- 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.