Fix archive decompression #12

This commit is contained in:
Safa Arıman
2019-08-26 20:17:56 +03:00
parent 4f39953702
commit 4e645f0a21
+4 -3
View File
@@ -187,7 +187,7 @@ class ArchiveBzip2(ArchiveBase):
import bz2 import bz2
bz2_file = bz2.BZ2File(self.file_path, "r") bz2_file = bz2.BZ2File(self.file_path, "r")
output = open(output_path, "w") output = open(output_path, "w")
output.write(bz2_file.read()) output.write(bz2_file.read().decode())
output.close() output.close()
bz2_file.close() bz2_file.close()
@@ -213,7 +213,7 @@ class ArchiveGzip(ArchiveBase):
import gzip import gzip
gzip_file = gzip.GzipFile(self.file_path, "r") gzip_file = gzip.GzipFile(self.file_path, "r")
output = open(output_path, "w") output = open(output_path, "w")
output.write(gzip_file.read()) output.write(gzip_file.read().decode())
output.close() output.close()
gzip_file.close() gzip_file.close()
@@ -240,7 +240,7 @@ class ArchiveLzma(ArchiveBase):
import lzma import lzma
lzma_file = lzma.LZMAFile(self.file_path, "r") lzma_file = lzma.LZMAFile(self.file_path, "r")
output = open(output_path, "w") output = open(output_path, "w")
output.write(lzma_file.read()) output.write(lzma_file.read().decode())
output.close() output.close()
lzma_file.close() lzma_file.close()
@@ -497,6 +497,7 @@ class ArchiveTarZ(ArchiveBase):
pass pass
self.tar.close() self.tar.close()
class Archive7Zip(ArchiveBase): class Archive7Zip(ArchiveBase):
"""Archive7Zip handles 7-Zip archives.""" """Archive7Zip handles 7-Zip archives."""