zulip_bots: Use utf-8 when reading fixtures.
This prevents issues with Python using platform specific encodings, such as CP1252 on Windows.
This commit is contained in:
parent
ced3a97b3f
commit
a475077da9
|
@ -29,7 +29,7 @@ def read_bot_fixture_data(bot_name, test_name):
|
||||||
base_path = os.path.realpath(os.path.join(os.path.dirname(
|
base_path = os.path.realpath(os.path.join(os.path.dirname(
|
||||||
os.path.abspath(__file__)), 'bots', bot_name, 'fixtures'))
|
os.path.abspath(__file__)), 'bots', bot_name, 'fixtures'))
|
||||||
http_data_path = os.path.join(base_path, '{}.json'.format(test_name))
|
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()
|
content = f.read()
|
||||||
http_data = json.loads(content)
|
http_data = json.loads(content)
|
||||||
return http_data
|
return http_data
|
||||||
|
|
Loading…
Reference in a new issue