From b81cd1fbd1720cb1ae8b7ef8b6443305b83dd47c Mon Sep 17 00:00:00 2001 From: Gustavo Nunes Date: Tue, 31 Mar 2020 00:00:18 -0300 Subject: [PATCH] Adding the encoding. At least on Windows, I tested it before, the terminal displays an error that implies with the charset. Adding the UTF-8, everything runs smoothly. --- emosent/emosent.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/emosent/emosent.py b/emosent/emosent.py index 977f4bf..e5c50ac 100644 --- a/emosent/emosent.py +++ b/emosent/emosent.py @@ -27,7 +27,11 @@ def _build_dict_from_csv(csv_path): emoji_sentiment_rankings = {} - with open(csv_path, newline='') as csv_file: + # MrMindy: + # Adding the encoding. At least on Windows, I tested it before, the terminal displays an error that implies + # with the charset. Adding the UTF-8, everything runs smoothly. + + with open(csv_path, newline='', encoding='utf-8') as csv_file: csv_reader = csv.reader(csv_file) _header_row = next(csv_reader) for row in csv_reader: