From 3653e5caf23bf2c1421e7a26fec954ec9aa5f459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Vask=C3=B3?= <1771332+vlaci@users.noreply.github.com> Date: Tue, 23 Jul 2024 19:57:28 +0200 Subject: [PATCH] fix(extract): ensure that reports are pickleable Unfortunately `dissect.cstruct` 4.0 types are not pickleable --- unblob/report.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unblob/report.py b/unblob/report.py index 99e6da262b..2d241661d3 100644 --- a/unblob/report.py +++ b/unblob/report.py @@ -13,6 +13,12 @@ class Report: """A common base class for different reports.""" + def __attrs_post_init__(self): + for field in attr.fields(type(self)): + value = getattr(self, field.name) + if isinstance(value, int): + object.__setattr__(self, field.name, int(value)) + def asdict(self) -> dict: return attr.asdict(self)