Skip to content
Snippets Groups Projects

Try several encodings to read old WEO releases

Closed Pierre Dittgen requested to merge flex_csv_read into master
2 unresolved threads
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
+ 2
2
@@ -65,9 +65,9 @@ def dataframe_from_csv(csv_file: Path, encoding_list):
for encoding in encoding_list:
try:
return pd.read_csv(csv_file, delimiter="\t", encoding=encoding)
except:
except UnicodeDecodeError:
pass
raise Exception(f"Can't find an encoding to read {csv_file!r}")
raise ValueError(f"Can't find an encoding to read {csv_file!r}")
def process_csv_file(