Skip to content

Commit 174e157

Browse files
author
ravi
committed
fixed python3 unicode error
1 parent 5a61f47 commit 174e157

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

forex_python/converter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def __init__(self):
7272

7373
def _get_data(self, currency_code):
7474
file_path = os.path.dirname(os.path.abspath(__file__))
75-
currency_data = json.loads(open(file_path+'/raw_data/currencies.json').read())
75+
with open(file_path+'/raw_data/currencies.json') as f:
76+
currency_data = json.loads(f.read())
7677
currency_dict = next((item for item in currency_data if item["cc"] == currency_code), None)
7778
return currency_dict
7879

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
VERSION = '0.2.2'
55

6-
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
6+
with open(os.path.join(os.path.dirname(__file__), 'README.md'), encoding='utf-8', errors='ignore') as readme:
77
LONG_DESCRIPTION = readme.read()
88

99

0 commit comments

Comments
 (0)