FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-75008: guess lineterminator in csv.Sniffer by vmax · Pull Request #18336 · python/cpython · GitHub

Repository navigation

gh-75008: guess lineterminator in csv.Sniffer - #18336

Closed
vmax wants to merge 5 commits into
python:mainfrom
vmax:bpo-30825
Closed

vmax wants to merge 5 commits into
python:mainfrom
vmax:bpo-30825

Conversation

vmax commented Feb 3, 2020 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown

vmax changed the title Bpo 30825 bpo-30825: guess lineterminator in csv.Sniffer Feb 3, 2020
vmax requested a review from csabella February 3, 2020 19:32
csabella removed their request for review February 4, 2020 00:34
Comment thread Lib/csv.py Outdated

rruuaanng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe csv.py should be sent to another reviewer for review.

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 7, 2026

Copy link
Copy Markdown
Member

Thank you for the patch, and sorry that it was left without attention for so long. The sniffer was rewritten on the main branch (gh-83273) and this patch no longer applies.

It should be easier now: the sample is split into lines keeping their line breaks, so detection can count '\r\n', '\n' and '\r' in a _detect_lineterminator() method, next to _detect_doublequote(). Note that falling back to os.linesep makes the result platform dependent; '\r\n' looks better for a sample without any line break.

serhiy-storchaka changed the title bpo-30825: guess lineterminator in csv.Sniffer gh-75008: guess lineterminator in csv.Sniffer Jul 21, 2026
github-actions Bot removed the stale Stale PR or inactive for long period of time. label Jul 26, 2026

Copy link
Copy Markdown
Member

#155061 implements this on the new engine. The only detail not covered above: the terminator is chosen by a majority vote among the line endings, with a tie broken in the order '\r\n', '\n', '\r'.

Closing as superseded. Thank you again for the patch.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

6 participants


Back | FazBrowse Home | New Git URL