mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #25624: ZipFile now always writes a ZIP_STORED header for directory
entries. Patch by Dingyuan Wang.
This commit is contained in:
commit
6e3d2ba269
4 changed files with 30 additions and 1 deletions
|
@ -1444,7 +1444,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue