mirror of
https://github.com/python/cpython.git
synced 2025-08-29 21:25:01 +00:00
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.
This commit is contained in:
parent
b47913f54f
commit
34cba33403
2 changed files with 6 additions and 2 deletions
|
@ -1028,11 +1028,12 @@ class ZipFile:
|
||||||
# set the modified flag so central directory gets written
|
# set the modified flag so central directory gets written
|
||||||
# even if no files are added to the archive
|
# even if no files are added to the archive
|
||||||
self._didModify = True
|
self._didModify = True
|
||||||
|
self._start_disk = 0
|
||||||
try:
|
try:
|
||||||
self.start_dir = self._start_disk = self.fp.tell()
|
self.start_dir = self.fp.tell()
|
||||||
except (AttributeError, OSError):
|
except (AttributeError, OSError):
|
||||||
self.fp = _Tellable(self.fp)
|
self.fp = _Tellable(self.fp)
|
||||||
self.start_dir = self._start_disk = 0
|
self.start_dir = 0
|
||||||
self._seekable = False
|
self._seekable = False
|
||||||
else:
|
else:
|
||||||
# Some file-like objects can provide tell() but not seek()
|
# Some file-like objects can provide tell() but not seek()
|
||||||
|
|
|
@ -140,6 +140,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- 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.
|
||||||
|
|
||||||
- Issue #13051: Fixed recursion errors in large or resized
|
- Issue #13051: Fixed recursion errors in large or resized
|
||||||
curses.textpad.Textbox. Based on patch by Tycho Andersen.
|
curses.textpad.Textbox. Based on patch by Tycho Andersen.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue