Explorar el Código

specify utf-8 opening the input file

xry111 hace 6 años
padre
commit
f844459625
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      csv_parser.py

+ 1 - 1
csv_parser.py

@@ -43,7 +43,7 @@ def data_from_row(d):
 
 def parse_data_from_csv(f):
     if type(f) == str:
-        with open(f) as fd:
+        with open(f, encoding='utf-8') as fd:
             return parse_data_from_csv(fd)
     from csv import DictReader
     rd = DictReader(f)