Message303387
This issue was 'reopened' by #31590.
I can understand inconsistency as a 'design bug', but design bugs are not code bugs, and fixing a design bugs is an enhancement issue, not a behavior issue.
It is not clear to me why, with the specified dialect, "writer.writerow(['one\nelement'])" is correct in writing 'one\\\nelement\n'. The doc for Dialect.excapechar says "A one-character string used by the writer to escape the delimiter if quoting is set to QUOTE_NONE and the quotechar if doublequote is False." Yes, quoting is set to QUOTE_NONE, but \n is the lineterminator, not the delimiter (or the quotechar). It looks to me that escaping the lineterminator might be a bug.
In any case, 'one\nelement' and 'one\\\nelement' are each 2 physical lines. I don't see anything in the doc about csv.reader joining physical lines into 'logical' lines the way that compile() does. |
|
Date |
User |
Action |
Args |
2017-09-30 03:06:00 | terry.reedy | set | recipients:
+ terry.reedy, r.david.murray, lukasz.langa, python-dev, serhiy.storchaka, maciej.szulik, kalaxy, mjohnson |
2017-09-30 03:06:00 | terry.reedy | set | messageid: <1506740760.26.0.213398074469.issue15927@psf.upfronthosting.co.za> |
2017-09-30 03:06:00 | terry.reedy | link | issue15927 messages |
2017-09-30 03:05:59 | terry.reedy | create | |
|