Prevent csv QUOTE_NONE writer panics without quotechar · RustPython/RustPython@f29b7a3 · GitHub
Skip to content

Commit f29b7a3

Browse files
committed
Prevent csv QUOTE_NONE writer panics without quotechar
Handle csv.writer rows with QUOTE_NONE through a RustPython-owned unquoted writer path so quotechar=None no longer reaches the unfinished csv_core configuration branch. Escape delimiter, newline, quotechar, and escapechar bytes according to the active dialect, and preserve CPython's single-empty-field error behavior. Constraint: Match CPython csv.writer behavior without changing Lib/ copied stdlib files. Rejected: Relying on csv_core QuoteStyle::Never | it does not model CPython QUOTE_NONE escaping with quotechar=None. Confidence: high Scope-risk: narrow Directive: Keep QUOTE_NONE writer behavior separate unless csv_core gains matching CPython semantics. Tested: prek run --all-files; cargo test --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher; cargo build --release --features sqlite; pytest -v in extra_tests Assisted-by: Codex:gpt-5.5
1 parent 0009dd6 commit f29b7a3

2 files changed

Lines changed: 132 additions & 6 deletions

File tree

crates/stdlib/src/csv.rs

Lines changed: 79 additions & 6 deletions

extra_tests/snippets/stdlib_csv.py

Lines changed: 53 additions & 0 deletions

0 commit comments

Comments
 (0)