cpython: f36f9bce997d (original) (raw)
Mercurial > cpython
changeset 105920:f36f9bce997d 3.6
Issue #29094: Offsets in a ZIP file created with extern file object and modes "w" and "x" now are relative to the start of the file. [#29094]
Serhiy Storchaka storchaka@gmail.com | |
---|---|
date | Sun, 01 Jan 2017 19:05:29 +0200 |
parents | 0331420d6cba(current diff)f5aa1c9c2b7e(diff) |
children | a80c14ace927 62d3c0336df6 |
files | Lib/zipfile.py Misc/NEWS |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-)[+] [-] Lib/zipfile.py 5 Misc/NEWS 3 |
line wrap: on
line diff
--- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -1102,11 +1102,12 @@ 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_disk = 0[](#l1.7) try:[](#l1.8)
self.start_dir = self._start_disk = self.fp.tell()[](#l1.9)
self.start_dir = self.fp.tell()[](#l1.10) except (AttributeError, OSError):[](#l1.11) self.fp = _Tellable(self.fp)[](#l1.12)
self.start_dir = self._start_disk = 0[](#l1.13)
self.start_dir = 0[](#l1.14) self._seekable = False[](#l1.15) else:[](#l1.16) # Some file-like objects can provide tell() but not seek()[](#l1.17)
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -40,6 +40,9 @@ Core and Builtins Library ------- +- Issue #29094: Offsets in a ZIP file created with extern file object and modes