diff --git a/personal_data/util.py b/personal_data/util.py index 69aa53c..b054aa6 100644 --- a/personal_data/util.py +++ b/personal_data/util.py @@ -148,7 +148,9 @@ def normalize_dict(d: dict[str,typing.Any]) -> frozendict[str,typing.Any]: def load_csv_file(csv_file: Path) -> list[frozendict]: dicts: list[frozendict] = [] with open(csv_file) as csvfile: - reader = csv.DictReader(csvfile, dialect=CSV_DIALECT) + dialect = csv.Sniffer().sniff(csvfile.read(1024)) + csvfile.seek(0) + reader = csv.DictReader(csvfile, dialect=dialect) for row in reader: for k in list(row.keys()): orig = row[k]