summaryrefslogtreecommitdiff
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-02-01 19:01:10 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-02-01 19:01:10 +0200
commit5b90f5de26fc6a659e8bb2224c31af89c0b71d0b (patch)
tree02782eac776472769c3e392680242cb911798596 /Lib/zipfile.py
parent7929be6aebc2b731035b650ad539c966d8c001d9 (diff)
downloadcpython-git-5b90f5de26fc6a659e8bb2224c31af89c0b71d0b.tar.gz
Don't seek to the start of the file when open ZipFile with the 'w' mode
(regression introduced in issue #14099).
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index 845c6a96fc..8c2950f533 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -1002,7 +1002,7 @@ 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_dir = 0
+ self.start_dir = self.fp.tell()
elif mode == 'a':
try:
# See if file is a zip file