mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-19 22:24:19 +01:00
backup: Ensure entries in the tx are bytes
We could end up in some cases with string-encoded statements.
This commit is contained in:
@@ -192,7 +192,8 @@ class FileBackend(Backend):
|
||||
def add_change(self, entry: Change) -> bool:
|
||||
typ = b'\x01' if entry.snapshot is None else b'\x02'
|
||||
if typ == b'\x01':
|
||||
payload = b'\x00'.join([t.encode('UTF-8') for t in entry.transaction])
|
||||
stmts = [t.encode('UTF-8') if isinstance(t, str) else t for t in entry.transaction]
|
||||
payload = b'\x00'.join(stmts)
|
||||
elif typ == b'\x02':
|
||||
payload = entry.snapshot
|
||||
|
||||
|
||||
Reference in New Issue
Block a user