Uh oh!
There was an error while loading. Please reload this page.
csv.Sniffer.has_header() leaks ValueError instead of csv.Error for an inconsistent guessed dialect #153634
Closed as not planned
There was an error while loading. Please reload this page.
Bug description:
csv.Sniffer.sniff()can guess a dialect whose delimiter equals its quote character. Using such a dialect leaks a rawValueErrorfrom the_csvextension instead of the module'scsv.Error;csv.Sniffer.has_header(), which builds a reader from the sniffed dialect, is the common trigger.CPython versions tested on:
3.13, 3.14, 3.15
Operating systems tested on:
macOS
Linked PRs