CSV: a custom delimiter in the sep= hint is rejected

Open Beginner friendly
#5,284 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@saiteja-018 is already working on this.

Since Nov 10, 2026.

  • #5285 by @saiteja-018 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
data

Research direction

Find the CSV backend and inspect how it parses the first-line sep= hint versus how it uses _DELIMITERS for csv.Sniffer. Run the reproduction with ^ and a space, then add or update CSV conversion tests for those delimiters and for mixed-case SEP=. Done means each hinted delimiter converts and the resulting table contains the four expected cells.

Written by the indexing model from the issue text.

Description

Bug

The CSV backend honors Excel's sep=<char> first line, but only when the character is one of the candidates used for delimiter sniffing (, ; tab | :). A file whose explicit hint names any other single character, such as ^ or a space, fails to convert with Cannot convert csv with unknown delimiter ^.

The hint names the delimiter, so the sniffer's candidate list must not apply to it. _DELIMITERS is documented as the characters handed to csv.Sniffer. The check that uses it was unreachable for a sniffed dialect, because the sniffer can only return one of those characters.

Steps to reproduce
from io import BytesIO

from docling.datamodel.base_models import DocumentStream
from docling.document_converter import DocumentConverter

for delimiter in ["^", " "]:
    text = f"sep={delimiter}\nName{delimiter}Price\nApple{delimiter}1.50\n"
    result = DocumentConverter().convert(
        DocumentStream(name="custom.csv", stream=BytesIO(text.encode())),
        raises_on_error=False,
    )
    message = result.errors[0].error_message if result.errors else ""
    print(repr(delimiter), result.status, message)

Actual:

'^' ConversionStatus.FAILURE Cannot convert csv with unknown delimiter ^.
' ' ConversionStatus.FAILURE Cannot convert csv with unknown delimiter  .

Expected: both files convert, and each table holds the cells Name, Price, Apple, 1.50.

The same failure occurs with an explicit SEP= hint in any letter case.

Docling version

2.150.0 (main 1ae470a)

Python version

3.12.14

Dominant language
Python
Stars
71k
Forks
5.4k
Avg merge
2d 22h
Merged PRs (30d)
161

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docling-project/docling

All issues in docling-project/docling

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.