-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
I assumed a csv tool would default to ',' as the delimiter, but this defaults to ';'. This is mentioned in the terminal help, but not the readme, and the failure mode is an IndexError, which is confusing:
Traceback (most recent call last):
File "./csv_anonymizer.py", line 152, in <module>
anonymize(source, target, column_index, int(ARGS.headerLines), ARGS.encoding, delimiter)
File "./csv_anonymizer.py", line 96, in anonymize
for row in anonymize_rows(reader, columnIndex):
File "./csv_anonymizer.py", line 74, in anonymize_rows
if len(row[columnIndex].strip()) > 0:
IndexError: list index out of range
(Because csv_anonymizer assumes ';', and your csv uses ',', csv_anonymizer is likely to treat a row as a single large field, and thus fail if given a columnIndex > 0.)
In addition to mentioning --delimiter in the readme, perhaps a try/except around that error, with a user-friendly warning if len(row) == 1?
Metadata
Metadata
Assignees
Labels
No labels