From e475ad66595cf3925dec8b09f1b43739e554a623 Mon Sep 17 00:00:00 2001 From: A_D Date: Mon, 15 Mar 2021 18:53:20 +0200 Subject: [PATCH] Ensured that CAPIData objects are JSON Serialisable While it isnt directly an issue in main (right now), the fix applies here forward, so we may as well do it here and not deal with a headache later. --- EDMarketConnector.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index e4aa7c30..280c2b2a 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -1216,14 +1216,11 @@ class AppWindow(object): ) if f: with open(f, 'wb') as h: - h.write(json.dumps( - data, - ensure_ascii=False, - indent=2, - sort_keys=True, - separators=(',', ': ')).encode('utf-8') - ) - + h.write(json.dumps(dict(data), + ensure_ascii=False, + indent=2, + sort_keys=True, + separators=(',', ': ')).encode('utf-8')) except companion.ServerError as e: self.status['text'] = str(e)