Do not cast bytes to strs
This commit is contained in:
parent
0e038cbb18
commit
4f97d95de3
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user