From 5d85735e009305436e96ed42ca9dd0817ce9570c Mon Sep 17 00:00:00 2001 From: Tauhid Ahmed <87439534+Tauhid-Ahmed8009@users.noreply.github.com> Date: Mon, 4 Sep 2023 00:26:49 +0600 Subject: [PATCH] Update converter.py added utf-8 encoding when opening curriencies.json. otherwise exception type: unicodedecodeerror exception value: 'ascii' codec can't decode byte 0xc3 in position 7400: ordinal not in range(128) in ubuntu server --- forex_python/converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forex_python/converter.py b/forex_python/converter.py index 4655b7b..695fe8c 100644 --- a/forex_python/converter.py +++ b/forex_python/converter.py @@ -124,7 +124,7 @@ def __init__(self): def _currency_data(self): if self.__currency_data is None: file_path = os.path.dirname(os.path.abspath(__file__)) - with open(file_path + '/raw_data/currencies.json') as f: + with open(file_path + '/raw_data/currencies.json', encoding="utf-8") as f: self.__currency_data = json.loads(f.read()) return self.__currency_data