Feature
Follow-up from #8302 / #8315.
csv.writer should accept an arbitrary string as lineterminator. RustPython stores it as a single byte, so a multi-character terminator is truncated instead of being emitted in full.
import csv, io
sio = io.StringIO()
csv.writer(sio, lineterminator="!@#").writerow(["a", "b"])
print(repr(sio.getvalue()))
# CPython: 'a,b!@#'
# RustPython: 'a,b!'
Because of this, test_write_lineterminator (Lib/test/test_csv.py) is marked @unittest.expectedFailure — it fails only on the '!@#' subcase.
Scope is limited to the multi-character lineterminator. Left as separate follow-ups: lineterminator validation parity, non-ASCII delimiter/quotechar/escapechar (see #8310), and reader semantics (CPython's reader ignores lineterminator and only recognizes CR/LF).
Python Documentation or reference to CPython source code
https://docs.python.org/3/library/csv.html#csv.Dialect.lineterminator
Drafted with AI assistance (Claude Code), reviewed by me.
Feature
Follow-up from #8302 / #8315.
csv.writershould accept an arbitrary string aslineterminator. RustPython stores it as a single byte, so a multi-character terminator is truncated instead of being emitted in full.Because of this,
test_write_lineterminator(Lib/test/test_csv.py) is marked@unittest.expectedFailure— it fails only on the'!@#'subcase.Scope is limited to the multi-character
lineterminator. Left as separate follow-ups: lineterminator validation parity, non-ASCIIdelimiter/quotechar/escapechar(see #8310), and reader semantics (CPython's reader ignoreslineterminatorand only recognizes CR/LF).Python Documentation or reference to CPython source code
https://docs.python.org/3/library/csv.html#csv.Dialect.lineterminator
Drafted with AI assistance (Claude Code), reviewed by me.