Set encoding when opening zips file.

This commit is contained in:
Albert Cervera i Areny 2018-08-20 16:51:03 +02:00
parent 94fbb68004
commit 598e2b8782
1 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,8 @@ class LoadCountryZips(Wizard):
delimiter = ','
quotechar = '"'
data = open(os.path.join(
os.path.dirname(__file__), 'country_zip_es.csv'))
os.path.dirname(__file__), 'country_zip_es.csv'), 'r',
encoding='utf-8')
try:
rows = reader(data, delimiter=delimiter, quotechar=quotechar)
except TypeError as e: