From ce351681066bc5cd9033a64787c809a27a639f71 Mon Sep 17 00:00:00 2001 From: Stefan de Reuver <9864602+Horofic@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:24:35 +0100 Subject: [PATCH 1/2] Apply workaround to pypy --- dissect/target/plugins/os/unix/locate/plocate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dissect/target/plugins/os/unix/locate/plocate.py b/dissect/target/plugins/os/unix/locate/plocate.py index 91a073d77..d0b97f970 100644 --- a/dissect/target/plugins/os/unix/locate/plocate.py +++ b/dissect/target/plugins/os/unix/locate/plocate.py @@ -114,12 +114,12 @@ def __init__(self, fh: BinaryIO): self.buf = RangeStream(self.fh, self.fh.tell(), self.compressed_length_bytes) def __iter__(self) -> Iterable[PLocateFile]: - # NOTE: This is a workaround for a PyPy 3.9 bug + # NOTE: This is a workaround for a PyPy bug # We don't know what breaks, but PyPy + zstandard = unhappy times # You just get random garbage data back instead of the decompressed data # This weird dance of using a decompressobj and unused data is the only way that seems to work # It's more expensive on memory, but at least it doesn't break - if platform.python_implementation() == "PyPy" and sys.version_info < (3, 10): + if platform.python_implementation() == "PyPy": obj = self.ctx.decompressobj() buf = self.buf.read() From 567b592cbd9c80833405a5d4cfb9caa62d409f20 Mon Sep 17 00:00:00 2001 From: Stefan de Reuver <9864602+Horofic@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:27:46 +0100 Subject: [PATCH 2/2] Remove unused import --- dissect/target/plugins/os/unix/locate/plocate.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dissect/target/plugins/os/unix/locate/plocate.py b/dissect/target/plugins/os/unix/locate/plocate.py index d0b97f970..4a5f0c047 100644 --- a/dissect/target/plugins/os/unix/locate/plocate.py +++ b/dissect/target/plugins/os/unix/locate/plocate.py @@ -1,7 +1,6 @@ from __future__ import annotations import platform -import sys from io import BytesIO from typing import BinaryIO, Iterable