From 9af87ba082080edd2753c653303a25a94aa680ee Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 5 Dec 2021 08:00:26 +1000 Subject: [PATCH] fix _db_command: TypeError: a bytes-like object is required, not 'list' Bytes come in as an array of integers, which we could probably solve on the PyO3 end instead, but this will do for now - the same fix is already used for non-DB case. https://forums.ankiweb.net/t/anki-2-1-50-beta/15608/15 --- pylib/anki/_backend/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylib/anki/_backend/__init__.py b/pylib/anki/_backend/__init__.py index dc443c853..49c6af7c6 100644 --- a/pylib/anki/_backend/__init__.py +++ b/pylib/anki/_backend/__init__.py @@ -97,7 +97,7 @@ class RustBackend(RustBackendGenerated): try: return from_json_bytes(self._backend.db_command(bytes_input)) except Exception as error: - err_bytes = error.args[0] + err_bytes = bytes(error.args[0]) err = backend_pb2.BackendError() err.ParseFromString(err_bytes) raise backend_exception_to_pylib(err)