提交 13ad4029 编写于 作者: L lolyu

utils.archive.extract_lzma: open in binary

fix that opens compressed file in binary instead of text mode.
Signed-off-by: Nlolyu <lolyu@redhat.com>
上级 55c03649
......@@ -118,7 +118,7 @@ if LZMA_CAPABLE:
extracted_file = os.path.splitext(path)[0]
if not force and os.path.exists(extracted_file):
return extracted_file
with open(path, 'r') as file_obj:
with open(path, 'rb') as file_obj:
with open(extracted_file, 'wb') as newfile_obj:
newfile_obj.write(lzma.decompress(file_obj.read()))
return extracted_file
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册