Skip to content

Commit

Permalink
Properly open file as 'wb' in archive_deterministically
Browse files Browse the repository at this point in the history
  • Loading branch information
marmeladema committed Dec 10, 2019
1 parent 3f48f28 commit 267eaad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/servo/command_base.py
Expand Up @@ -110,9 +110,9 @@ def reset(tarinfo):
# packaging (in case of exceptional situations like running out of disk space).
# TODO do this in a temporary folder after #11983 is fixed
temp_file = '{}.temp~'.format(dest_archive)
with os.fdopen(os.open(temp_file, os.O_WRONLY | os.O_CREAT, 0o644), 'w') as out_file:
with os.fdopen(os.open(temp_file, os.O_WRONLY | os.O_CREAT, 0o644), 'wb') as out_file:
if dest_archive.endswith('.zip'):
with zipfile.ZipFile(temp_file, 'w', zipfile.ZIP_DEFLATED) as zip_file:
with zipfile.ZipFile(out_file, 'w', zipfile.ZIP_DEFLATED) as zip_file:
for entry in file_list:
arcname = entry
if prepend_path is not None:
Expand Down

0 comments on commit 267eaad

Please sign in to comment.