Skip to content

csv.writer QUOTE_NONE with quotechar=None panics #8200

Description

@doma17

Summary

csv.writer(..., quoting=csv.QUOTE_NONE, quotechar=None, escapechar="\\") panics in RustPython.

Reproducer

import csv
import io

buf = io.StringIO()
csv.writer(
    buf,
    quoting=csv.QUOTE_NONE,
    quotechar=None,
    escapechar="\\",
).writerow(["a,b", 'x"y'])

print(repr(buf.getvalue()))

Expected

CPython writes:

'a\\,b,x"y\r\n'

The delimiter is escaped. The double quote is not special because quotechar=None.

Actual

RustPython reaches todo!() in crates/stdlib/src/csv.rs and panics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions