Skip to content

Commit

Permalink
scripts: Set file permissions when building .zip archive
Browse files Browse the repository at this point in the history
It looks like zipfile module by default uses the permission mask 0,
which after unpacking on Unix-based systems leads to the files being
inaccessible.

We now explicitly set file mask to rw-r--r-- to match .tar.gz defaults.

Fixes zeux#217.
  • Loading branch information
zeux committed Jul 23, 2018
1 parent c12889f commit 699143c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def write_zip(target, arcprefix, timestamp, sources):
info = zipfile.ZipInfo(path)
info.date_time = time.localtime(timestamp)
info.compress_type = zipfile.ZIP_DEFLATED
info.external_attr = 0644 << 16L
archive.writestr(info, data)

def write_tar(target, arcprefix, timestamp, sources, compression):
Expand Down

0 comments on commit 699143c

Please sign in to comment.