Skip to content

Feature request: sniff csv quoting and lineterminator #129374

Open
@Nikilauz

Description

@Nikilauz

If you read a csv file, alter the data and then write it back, it would be very nice to recreate also the quoting behaviour. So e.g. if the file is quoted in style csv.QUOTE_NONNUMERIC, it would be very useful to have the quoting property set correctly in the dialect object returned by csv.Sniffer().sniff.
Also, I just figured out that the line terminator is also hard-coded to "\r\n". Would also be nice to be adaptive...

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions