Peter Otten added the comment:
While I don't think that the csv module should second-guess broken input you
might consider "fixing" your data on the fly:
def close_quote(line):
if line.count('"') % 2:
line = line.rstrip("\n") + '"\n'
return line
with open("data.csv") as f:
for row in csv.reader(map(close_quote, f)):
print(row)
That should give the desired output.
----------
nosy: +peter.otten
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue30034>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com