There was an error while loading. Please reload this page.
1 parent b47913f commit 34cba33Copy full SHA for 34cba33
2 files changed
Lib/zipfile.py
@@ -1028,11 +1028,12 @@ def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=True):
1028
# set the modified flag so central directory gets written
1029
# even if no files are added to the archive
1030
self._didModify = True
1031
+ self._start_disk = 0
1032
try:
- self.start_dir = self._start_disk = self.fp.tell()
1033
+ self.start_dir = self.fp.tell()
1034
except (AttributeError, OSError):
1035
self.fp = _Tellable(self.fp)
- self.start_dir = self._start_disk = 0
1036
+ self.start_dir = 0
1037
self._seekable = False
1038
else:
1039
# Some file-like objects can provide tell() but not seek()
Misc/NEWS
@@ -140,6 +140,9 @@ Core and Builtins
140
Library
141
-------
142
143
+- Issue #29094: Offsets in a ZIP file created with extern file object and modes
144
+ "w" and "x" now are relative to the start of the file.
145
+
146
- Issue #13051: Fixed recursion errors in large or resized
147
curses.textpad.Textbox. Based on patch by Tycho Andersen.
148
0 commit comments