Kaydet (Commit) 5b90f5de authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Don't seek to the start of the file when open ZipFile with the 'w' mode

(regression introduced in issue #14099).
üst 7929be6a
...@@ -1002,7 +1002,7 @@ class ZipFile: ...@@ -1002,7 +1002,7 @@ 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_dir = 0 self.start_dir = self.fp.tell()
elif mode == 'a': elif mode == 'a':
try: try:
# See if file is a zip file # See if file is a zip file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment