Licht Takeuchi <lich...@outlook.jp> added the comment: I think the first one is buggy and there are two reasons.
1. The both are valid CSV. The double quoting is unnecessary. Some other applications, eg. Excel, does not use the double quoting. Also, the current implementation make to quote only if the string is '' and the output is at the first line. 2. '' is not quoted when the two columns case. ## Input: ``` import csv fp = open('test.csv', 'w') w = csv.writer(fp, dialect=None) w.writerow(['', '']) w.writerow(['3', 'a']) fp.close() ``` ## Output: ``` , 3,a ``` These seem inconsistent and the quoting is unnecessary in this case. # References http://www.ietf.org/rfc/rfc4180.txt ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32255> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com