From 797d68b2966d4793bbe309545f8cb6f200170fb0 Mon Sep 17 00:00:00 2001 From: Myned Date: Sun, 31 Dec 2017 22:09:23 -0500 Subject: [PATCH] Possible fix for TypeError --- src/utils/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/utils.py b/src/utils/utils.py index cdc0967..5d3e33d 100644 --- a/src/utils/utils.py +++ b/src/utils/utils.py @@ -40,12 +40,12 @@ except FileNotFoundError: def setdefault(filename, default=None, json=False): if json: try: - with open(filename, 'rb') as infile: + with open(filename, 'r') as infile: print(f'LOADED : {filename}') return jsn.load(infile) except FileNotFoundError: - with open(filename, 'wb+') as iofile: + with open(filename, 'w+') as iofile: print(f'FILE NOT FOUND : {filename} created and loaded with default values') jsn.dump(default, iofile) iofile.seek(0)