GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `csv.Sniffer.sniff()` raises `Could not determine delimiter` when the sample contains a field larger than field_size_limit() · Issue #157678 · python/cpython

csv.Sniffer.sniff() raises Could not determine delimiter when the sample contains a field larger than field_size_limit() #157678

New issue
Copy link
New issue
Copy link
Open
Open
csv.Sniffer.sniff() raises Could not determine delimiter when the sample contains a field larger than field_size_limit()#157678
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

@lpyu001
lpyu001
opened on Sep 17, 2026
Issue body actions

Bug report

Bug description:

Summary

csv.Sniffer().sniff() raises csv.Error: Could not determine delimiter for a sample whose first row contains a field longer than the current csv.field_size_limit() (131072 by default), even when every following row is consistently delimited.

Reproduction Code

import csv 
 
sample = 'a,"' + 'x' * 200_000 + '",b\n' + 'c,d,e\n' * 50 
print(csv.Sniffer().sniff(sample).delimiter) 

Actual Behavior

Traceback (most recent call last): 
  File "repro.py", line 4, in <module> 
    print(csv.Sniffer().sniff(sample).delimiter) 
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^ 
  File "Lib/csv.py", line 384, in sniff 
    raise Error("Could not determine delimiter") 
_csv.Error: Could not determine delimiter 

Expected Behavior

sniff() should return a dialect with `delimiter=','

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

  • gh-157678: Allow csv.Sniffer to inspect large fields #157689

Activity

  1. lpyu001
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Sep 17, 2026
  2. lpyu001 commented on Sep 17, 2026

    @lpyu001
    lpyu001
    on Sep 17, 2026
    ContributorAuthor
    More actions

    it could be a regression introduced by #153694

  3. GruffElixir
    added a commit that references this issue on Sep 17, 2026

    pythongh-157678: Allow Sniffer to inspect large fields

    1bae00d
  4. aisk
    added this to CSV issues 📊on Sep 17, 2026
  5. aisk
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Sep 17, 2026
  6. GruffElixir
    added 2 commits that reference this issue on Sep 20, 2026

    pythongh-157678: Avoid changing shared CSV field limit

    23cd0b0

    pythongh-157678: Avoid changing shared CSV field limit

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

Metadata

Metadata

Assignees

No one assigned

    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

    • CSV issues 📊
      Status
      No status
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.