From ca5691e21f536ede61e59ba56be62d2f5711add0 Mon Sep 17 00:00:00 2001 From: doomedraven Date: Tue, 1 Oct 2019 14:00:51 +0200 Subject: [PATCH 1/5] xz, udf support, last try --- sflock/unpack/zip7.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sflock/unpack/zip7.py b/sflock/unpack/zip7.py index 9f8a61cc..f1c73fd3 100644 --- a/sflock/unpack/zip7.py +++ b/sflock/unpack/zip7.py @@ -13,9 +13,9 @@ class Zip7File(Unpacker): name = "7zfile" exe = "/usr/bin/7z" - exts = b".7z", b".iso" + exts = b".7z", b".iso", b".xz" # TODO Should we use "isoparser" (check PyPI) instead of 7z? - magic = "7-zip archive", "ISO 9660" + magic = "7-zip archive", "ISO 9660", "UDF filesystem data", "XZ compressed data" def unpack(self, password=None, duplicates=None): dirpath = tempfile.mkdtemp() From 5abb4bd38660d25813ecfdc69d88f95693aeeab7 Mon Sep 17 00:00:00 2001 From: doomedraven Date: Tue, 1 Oct 2019 14:08:58 +0200 Subject: [PATCH 2/5] Update test_main.py --- tests/test_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_main.py b/tests/test_main.py index 87135fd5..0ccc9a28 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -25,7 +25,7 @@ def test_count_supported(): count += 1 if Zip7File(None).supported(): - count += 5 + count += 6 assert count == len(supported()) From aef0b7e9b00d26bad8b4c8f1b8a33657f093c110 Mon Sep 17 00:00:00 2001 From: doomedraven Date: Tue, 1 Oct 2019 14:16:59 +0200 Subject: [PATCH 3/5] Update test_main.py --- tests/test_main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_main.py b/tests/test_main.py index 0ccc9a28..1e2a14cc 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -13,7 +13,7 @@ def test_supported(): assert supported() def test_count_supported(): - count = 9 + count = 10 if AceFile(None).supported(): count += 1 @@ -25,7 +25,7 @@ def test_count_supported(): count += 1 if Zip7File(None).supported(): - count += 6 + count += 5 assert count == len(supported()) From dda467e7ed3d738d0bf09c951a14eda19e0ed7cd Mon Sep 17 00:00:00 2001 From: doomedraven Date: Tue, 1 Oct 2019 14:22:56 +0200 Subject: [PATCH 4/5] Update test_magic.py --- tests/test_magic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_magic.py b/tests/test_magic.py index 4a6965f9..e0bc7ceb 100644 --- a/tests/test_magic.py +++ b/tests/test_magic.py @@ -18,8 +18,8 @@ def test_magic(): def test_magic_exception(): assert magic.from_file( - "tests/files/invld.elf_" + b"tests/files/invld.elf_" ).startswith("ELF") assert magic.from_buffer( - open("tests/files/invld.elf_", "rb").read() + open(b"tests/files/invld.elf_", "rb").read() ).startswith("ELF") From 545f61916f27b847245c8a1f32f8500c538741b7 Mon Sep 17 00:00:00 2001 From: doomedraven Date: Tue, 1 Oct 2019 14:31:56 +0200 Subject: [PATCH 5/5] Update test_magic.py --- tests/test_magic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_magic.py b/tests/test_magic.py index e0bc7ceb..b3b57acc 100644 --- a/tests/test_magic.py +++ b/tests/test_magic.py @@ -19,7 +19,7 @@ def test_magic(): def test_magic_exception(): assert magic.from_file( b"tests/files/invld.elf_" - ).startswith("ELF") + ).startswith(b"ELF") assert magic.from_buffer( open(b"tests/files/invld.elf_", "rb").read() ).startswith("ELF")