From 0e038cbb181f4901afd99576dba29a3c42713610 Mon Sep 17 00:00:00 2001 From: evilchili Date: Sat, 18 Oct 2025 17:24:04 -0700 Subject: [PATCH] Do not cast bytes to strs --- src/grung/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grung/types.py b/src/grung/types.py index 09da45a..2006b77 100644 --- a/src/grung/types.py +++ b/src/grung/types.py @@ -343,7 +343,7 @@ class TextFilePointer(BinaryFilePointer): extension: str = ".txt" def prepare(self, data: value_type): - if data: + if data and not isinstance(data, bytes): return str(data).encode() def deserialize(self, value: str, db: TinyDB, recurse: bool = True) -> value_type: