From de90f6a8b7187e2c9a07b64d51b35f88bc4e2b57 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sat, 4 May 2024 22:57:34 -0400 Subject: [PATCH] fix(aurora): troubleshooting this annoying json issue --- aurora/utilities/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aurora/utilities/utils.py b/aurora/utilities/utils.py index fc92032..c6e7b19 100644 --- a/aurora/utilities/utils.py +++ b/aurora/utilities/utils.py @@ -135,8 +135,9 @@ def generate_dict(bot: Red, result: dict, guild_id: int) -> dict: duration = None if result[14] is not None: - logger.debug('%s\n%s', result[14], result[14].replace('\\"', '"').replace('["{', '[{').replace('}"]', '}]')) - changes = json.loads(result[14].replace('\\"', '"').replace('["{', '[{').replace('}"]', '}]')) + json_str = f'{result[14].replace('\\"', '"').replace('["{', '[{').replace('}"]', '}]')}' + logger.debug('%s\n%s', result[14], json_str) + changes = json.loads(json_str) change_obj_list = [] for change in changes: change_obj_list.append(Change.from_dict(bot=bot, data=change))