Bug description:
csv.Sniffer.sniff() can guess a dialect whose delimiter equals its quote character. Using such a dialect leaks a raw ValueError from the _csv extension instead of the module's csv.Error; csv.Sniffer.has_header(), which builds a reader from the sniffed dialect, is the common trigger.
import csv
csv.Sniffer().has_header("''") # ValueError, not csv.Error
CPython versions tested on:
3.13, 3.14, 3.15
Operating systems tested on:
macOS
Linked PRs
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