From 4e645f0a216fd2bf50e48fee3a38d00576526977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Safa=20Ar=C4=B1man?= Date: Mon, 26 Aug 2019 20:17:56 +0300 Subject: [PATCH] Fix archive decompression #12 --- pisi/archive.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pisi/archive.py b/pisi/archive.py index 7673ce1b..d4205bcb 100644 --- a/pisi/archive.py +++ b/pisi/archive.py @@ -187,7 +187,7 @@ class ArchiveBzip2(ArchiveBase): import bz2 bz2_file = bz2.BZ2File(self.file_path, "r") output = open(output_path, "w") - output.write(bz2_file.read()) + output.write(bz2_file.read().decode()) output.close() bz2_file.close() @@ -213,7 +213,7 @@ class ArchiveGzip(ArchiveBase): import gzip gzip_file = gzip.GzipFile(self.file_path, "r") output = open(output_path, "w") - output.write(gzip_file.read()) + output.write(gzip_file.read().decode()) output.close() gzip_file.close() @@ -240,7 +240,7 @@ class ArchiveLzma(ArchiveBase): import lzma lzma_file = lzma.LZMAFile(self.file_path, "r") output = open(output_path, "w") - output.write(lzma_file.read()) + output.write(lzma_file.read().decode()) output.close() lzma_file.close() @@ -497,6 +497,7 @@ class ArchiveTarZ(ArchiveBase): pass self.tar.close() + class Archive7Zip(ArchiveBase): """Archive7Zip handles 7-Zip archives."""