From a475077da979351a04656f1681a8a508e4d59228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20H=C3=B6nig?= Date: Thu, 14 Dec 2017 11:22:21 +0100 Subject: [PATCH] zulip_bots: Use utf-8 when reading fixtures. This prevents issues with Python using platform specific encodings, such as CP1252 on Windows. --- zulip_bots/zulip_bots/test_file_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zulip_bots/zulip_bots/test_file_utils.py b/zulip_bots/zulip_bots/test_file_utils.py index c79e1d9..a005db5 100644 --- a/zulip_bots/zulip_bots/test_file_utils.py +++ b/zulip_bots/zulip_bots/test_file_utils.py @@ -29,7 +29,7 @@ def read_bot_fixture_data(bot_name, test_name): base_path = os.path.realpath(os.path.join(os.path.dirname( os.path.abspath(__file__)), 'bots', bot_name, 'fixtures')) http_data_path = os.path.join(base_path, '{}.json'.format(test_name)) - with open(http_data_path) as f: + with open(http_data_path, encoding='utf-8') as f: content = f.read() http_data = json.loads(content) return http_data