Skip to content

csv.writer ignores a dialect's quoting and lineterminator #8253

Closed

Description

@jinmay

Feature

csv.writer ignores the quoting and lineterminator of a dialect (passed by
name or as an object) — only explicit keyword arguments take effect. So writing
with a built-in dialect differs from CPython.

import csv, io
sio = io.StringIO()
csv.writer(sio, dialect='unix').writerow([1, 'abc def', 'abc'])
print(repr(sio.getvalue()))
# CPython:    '"1","abc def","abc"\n'
# RustPython: '1,abc def,abc\r\n'

Python Documentation or reference to CPython source code

https://docs.python.org/3/library/csv.html#csv.Dialect
(unix_dialect = QUOTE_ALL + lineterminator='\n')

Drafted with AI assistance (Claude Code), reviewed by me.

Activity

  1. jinmay commented on Jul 11, 2026

    @jinmay
    ContributorAuthor

    take

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

Metadata

Metadata

Labels

z-ca-2026Tag to track Contribution Academy 2026

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions