I have a string called group_data, which I want to read with Python's csv.reader. This is the call I am making.
group = csv.reader(group_data.split('\n'), delimiter=';',
doublequote=True, quoting=csv.QUOTE_ALL, strict=True)
I want that this raises an exception whenever one of the following is the case:
- There is a single quote:
"A";"B "bb" B";"C"instead of"A";"B ""bb"" B";"C") - Any of the fields is not
quoted:
A;B;Cinstead of"A";"B";"C"
However, the excerpt above accepts both lines as correct, even with the doublequote=True, quoting=csv.QUOTE_ALL, and strict=True settings. Is there another option I should set to make it fail? If this is not possible, is there another way to quickly notice if there is a single quote or an unquoted field?