summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-11-22 12:49:58 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-11-22 12:49:58 (GMT)
commit8bc792a602311e426cbd69293627fdc9287a5c7b (patch)
tree24eac68b6a0c114c14a9efacc043b85b41025a1d /Lib/zipfile.py
parent04d759b1e4cb5b2d9ed13555e952565ccd3ce3bd (diff)
downloadcpython-8bc792a602311e426cbd69293627fdc9287a5c7b.zip
cpython-8bc792a602311e426cbd69293627fdc9287a5c7b.tar.gz
cpython-8bc792a602311e426cbd69293627fdc9287a5c7b.tar.bz2
Issue #25624: ZipFile now always writes a ZIP_STORED header for directory
entries. Patch by Dingyuan Wang.
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r--Lib/zipfile.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py
index bda6134..11d7cf9 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -1337,7 +1337,9 @@ class ZipFile:
arcname += '/'
zinfo = ZipInfo(arcname, date_time)
zinfo.external_attr = (st[0] & 0xFFFF) << 16 # Unix attributes
- if compress_type is None:
+ if isdir:
+ zinfo.compress_type = ZIP_STORED
+ elif compress_type is None:
zinfo.compress_type = self.compression
else:
zinfo.compress_type = compress_type