From 6889ae7e0e98b1ca30ef081b452801862d4ef23d Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Fri, 15 May 2020 01:38:07 +0200 Subject: Specify the encoding to use when opening card files Signed-off-by: Olivier Gayot --- swiftstory/Cards.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'swiftstory') diff --git a/swiftstory/Cards.py b/swiftstory/Cards.py index a2160a9..3d314c3 100644 --- a/swiftstory/Cards.py +++ b/swiftstory/Cards.py @@ -5,12 +5,12 @@ class Cards: @staticmethod def get_white_cards(lang): ''' Read the file containing the white cards and return a list of cards ''' - with open('usr/share/swiftstory/lang/' + lang + '/cards/white.json') as fh: + with open('usr/share/swiftstory/lang/' + lang + '/cards/white.json', encoding='utf-8') as fh: return json.load(fh) @staticmethod def get_black_cards(lang): ''' Read the file containing the black cards and return a list of cards ''' - with open('usr/share/swiftstory/lang/' + lang + '/cards/black.json') as fh: + with open('usr/share/swiftstory/lang/' + lang + '/cards/black.json', encoding='utf-8') as fh: return json.load(fh) -- cgit v1.2.3