mirror of
https://github.com/servo/servo.git
synced 2025-06-09 17:13:24 +00:00
Properly open file as 'wb' in archive_deterministically
This commit is contained in:
parent
3f48f2863c
commit
267eaad4eb
1 changed files with 2 additions and 2 deletions
|
@ -110,9 +110,9 @@ def archive_deterministically(dir_to_archive, dest_archive, prepend_path=None):
|
||||||
# packaging (in case of exceptional situations like running out of disk space).
|
# packaging (in case of exceptional situations like running out of disk space).
|
||||||
# TODO do this in a temporary folder after #11983 is fixed
|
# TODO do this in a temporary folder after #11983 is fixed
|
||||||
temp_file = '{}.temp~'.format(dest_archive)
|
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'):
|
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:
|
for entry in file_list:
|
||||||
arcname = entry
|
arcname = entry
|
||||||
if prepend_path is not None:
|
if prepend_path is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue