From 4f6aace686d5fe8b4a76ce8c107cd5ee8e79a207 Mon Sep 17 00:00:00 2001 From: Jakub Onderka Date: Wed, 3 Apr 2024 17:12:56 +0200 Subject: [PATCH] fix: [internal] Correct way to convert bytes to string if orjson exists --- pymisp/abstract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymisp/abstract.py b/pymisp/abstract.py index 41b335a..a7ccb8e 100644 --- a/pymisp/abstract.py +++ b/pymisp/abstract.py @@ -252,7 +252,7 @@ class AbstractMISP(MutableMapping, MISPFileCache, metaclass=ABCMeta): # type: i option |= orjson.OPT_INDENT_2 # orjson dumps method returns bytes instead of bytes, to keep compatibility with json # we have to convert output to str - return str(dumps(self, default=pymisp_json_default, option=option)) + return dumps(self, default=pymisp_json_default, option=option).decode() return dumps(self, default=pymisp_json_default, sort_keys=sort_keys, indent=indent)