-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Closed as not planned
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
I encountered an issue while using csv.Sniffer().has_header() in Python's built-in csv module. Despite providing a CSV file with a clear header, the function returns False, whereas the expected result is True.
import csv
with open('1.csv', mode='r', encoding='utf-8') as file:
sample = file.read(1024)
has_header = csv.Sniffer().has_header(sample)
print(f"Has header: {has_header}")
1.csv
filename,path
c.txt,/tmp/c.txt
python.txt,/tmp/python.txt
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done