Skip to content

gh-161400: Fix csv.Sniffer dropping empty space-delimited fields - #161401

Open
fedonman wants to merge 1 commit into
python:mainfrom
fedonman:fix-csv-sniffer-skipinitialspace-tie
Open

fedonman wants to merge 1 commit into
python:mainfrom
fedonman:fix-csv-sniffer-skipinitialspace-tie

Conversation

@fedonman

@fedonman fedonman commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

csv.Sniffer.sniff() returned skipinitialspace=True for a space-delimited sample with an empty field whenever both readings had the same number of distinct row widths, even when the other reading was more consistent. The two readings are now compared by the share of rows with the most common width, the measure sniff() already uses to choose the delimiter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant