set encoding to 'utf-8' in calls to open

This commit is contained in:
thomwolf
2018-12-14 13:48:58 +01:00
parent e1eab59aac
commit ae88eb88a4
7 changed files with 13 additions and 11 deletions

View File

@@ -227,7 +227,7 @@ def read_set_from_file(filename: str) -> Set[str]:
Expected file format is one item per line.
'''
collection = set()
with open(filename, 'r') as file_:
with open(filename, 'r', encoding='utf-8') as file_:
for line in file_:
collection.add(line.rstrip())
return collection