Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct ZIP permissions when building on Windows #716

Merged
merged 1 commit into from
Mar 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions zappa/zappa.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,12 @@ def splitpath(path):
# Related: https://github.com/Miserlou/Zappa/issues/682
os.chmod(os.path.join(root, filename), 0o755)

# Actually the file into the proper place in the zip
zipf.write(os.path.join(root, filename), os.path.join(root.replace(temp_project_path, ''), filename))
zipf.external_attr = 0755 << 16L
# Actually put the file into the proper place in the zip
zipi = zipfile.ZipInfo(os.path.join(root.replace(temp_project_path, '').lstrip(os.sep), filename))
zipi.create_system = 3
zipi.external_attr = 0o755 << 16L
with open(os.path.join(root, filename), 'rb') as f:
zipf.writestr(zipi, f.read(), compression_method)

if '__init__.py' not in files:
tmp_init = os.path.join(temp_project_path, '__init__.py')
Expand Down