diff --git a/src/grung/types.py b/src/grung/types.py index 2becdc7..2c67954 100644 --- a/src/grung/types.py +++ b/src/grung/types.py @@ -304,7 +304,9 @@ class FilePointer(Field): relpath = self.relpath(record) path = db.path / relpath path.parent.mkdir(parents=True, exist_ok=True) - path.write_bytes(record[self.name]) + path.write_bytes( + record[self.name] if isinstance(record[self.name], FilePointer.value_type) else record[self.name].encode() + ) record[self.name] = str(relpath)