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(['"'])
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
Linked PRs
The documented behavior of
csv.QUOTE_MINIMALis that fields containing the quote character should be quoted.However, running:
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
Linked PRs