From 49407025c9ae87f79101ce3bff03ea3817279655 Mon Sep 17 00:00:00 2001 From: Dale Wahl Date: Thu, 20 Feb 2025 16:07:36 +0100 Subject: [PATCH] dataset: do not feed blank dict to csv.DictReader for no reason --- common/lib/dataset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/lib/dataset.py b/common/lib/dataset.py index 22d4a9d3..e63df388 100644 --- a/common/lib/dataset.py +++ b/common/lib/dataset.py @@ -283,7 +283,7 @@ def _iterate_items(self, processor=None): if path.suffix.lower() == ".csv": with path.open("rb") as infile: wrapped_infile = NullAwareTextIOWrapper(infile, encoding="utf-8") - reader = csv.DictReader(wrapped_infile, **csv_parameters) + reader = csv.DictReader(wrapped_infile) if not self.get_own_processor(): # Processor was deprecated or removed; CSV file is likely readable but some legacy types are not @@ -630,7 +630,7 @@ def is_rankable(self, multiple_items=True): column_options.add("word_1") with self.get_results_path().open(encoding="utf-8") as infile: - reader = csv.DictReader(infile, {}) + reader = csv.DictReader(infile) try: return len(set(reader.fieldnames) & column_options) >= 3 except (TypeError, ValueError):