diff --git a/src/grung/types.py b/src/grung/types.py index 2006b77..692a2f6 100644 --- a/src/grung/types.py +++ b/src/grung/types.py @@ -343,8 +343,9 @@ class TextFilePointer(BinaryFilePointer): extension: str = ".txt" def prepare(self, data: value_type): - if data and not isinstance(data, bytes): - return str(data).encode() + if isinstance(data, bytes): + return data + return str(data).encode() def deserialize(self, value: str, db: TinyDB, recurse: bool = True) -> value_type: if not value: