diff options
author | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-05-15 01:38:07 +0200 |
---|---|---|
committer | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-05-15 02:47:20 +0200 |
commit | 6889ae7e0e98b1ca30ef081b452801862d4ef23d (patch) | |
tree | 89826bbe1a5f716b0b250560a7b57bb79cf8830b /swiftstory | |
parent | a6d1a66841bfde5190f49a74da46d58923185402 (diff) |
Specify the encoding to use when opening card files
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'swiftstory')
-rw-r--r-- | swiftstory/Cards.py | 4 |
1 files changed, 2 insertions, 2 deletions
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) |