mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Lloyds Bank (UK) CSV files include a trailing comma in the header row but not in the data rows, causing the `csvimport.parse` function to skip the data rows. This occurs because the header length exceeds the row length, making them unequal to `hint.cols`. This commit adjusts the length check to allow a range of acceptable row lengths, from the index of the last non-empty column in the header to `hint.cols`. This ensures compatibility with headers containing one or more trailing commas without affecting rows with correctly labelled columns. The solution avoids breaking changes by leaving underlying data structures untouched. Alternative approaches, such as dropping trailing commas before parsing or removing empty elements after parsing, were avoided due to potential risks. Specifically, trailing columns might contain data that banks provide but fail to label in the header row.