Skip to content

Commit e500664

Browse files
committed
Hard-code extr_attr header and normalize filesize
1 parent 5226b3a commit e500664

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/zipfile_deterministic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,13 +1023,13 @@ def write(self, filename, arcname=None, compress_type=None, date_time=(1980,1,1,
10231023
if isdir:
10241024
arcname += '/'
10251025
zinfo = ZipInfo(arcname, date_time)
1026-
zinfo.external_attr = (st[0] & 0xFFFF) << 16L # Unix attributes
1026+
zinfo.external_attr = 0600 << 16 # Unix attributes, hard-coded
10271027
if compress_type is None:
10281028
zinfo.compress_type = self.compression
10291029
else:
10301030
zinfo.compress_type = compress_type
10311031

1032-
zinfo.file_size = st.st_size
1032+
zinfo.file_size = long(st.st_size)
10331033
zinfo.flag_bits = 0x00
10341034
zinfo.header_offset = self.fp.tell() # Start of header bytes
10351035

0 commit comments

Comments
 (0)