Open
Description
The documented behavior of csv.QUOTE_MINIMAL
is that fields containing the quote character should be quoted.
However, running:
import csv
with open('trash.csv', 'w') as csvfile:
writer = csv.writer(csvfile, quoting=csv.QUOTE_MINIMAL, doublequote=False, escapechar='\\')
writer.writerow(['"'])
> cat trash.csv
\"
My expectation is that this field would have been quoted (e.g., "\""
), as it contains the quote character (escaped). If this is intended behavior, then the documentation should be clarified, or if it's not, this is a bug.
Your environment
- Operating system and architecture: Ubuntu 22.04
Metadata
Metadata
Assignees
Projects
Status
No status