Skip to content

csv.writer QUOTE_NONE with quotechar=None panics #8200

Closed

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions