Skip to content

Commit

Permalink
Use filename instead of already opened file descriptor when calling Z…
Browse files Browse the repository at this point in the history
…ipFile

This should fix #25251
  • Loading branch information
marmeladema committed Dec 12, 2019
1 parent b3b72cb commit e6a3a97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/servo/command_base.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def reset(tarinfo):
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), 'wb') 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(out_file, 'w', zipfile.ZIP_DEFLATED) as zip_file: with zipfile.ZipFile(temp_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:
Expand Down

0 comments on commit e6a3a97

Please sign in to comment.