Sebastian Bank added the comment:
To be complete, the docs of Dialect.escapechar should probably also say that it
is used to escape itself.
However, note that csw.writer currently only does this with csv.QUOTE_NONE
(breaking round-trip otherwise: #12178).
Sebastian Bank added the comment:
I am not sure about the design vs. code bug distinction, but what makes me
think this should be fixed is primarily the broken round-trip (already
mentioned above):
>>> import io, csv
>>> def roundtrip(value, **fmtparams):
Terry J. Reedy added the comment:
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
Michael Johnson added the comment:
On input, the reader sees a line like
['one\\\n','element']
from the file iterator and successfully escapes the newline character, but
still interprets the end of the string as the end of a record. I've attached a
patch that modifies this behavior, so
Roundup Robot added the comment:
New changeset 940748853712 by R David Murray in branch 'default':
#15927: Fix cvs.reader parsing of escaped \r\n with quoting off.
http://hg.python.org/cpython/rev/940748853712
--
nosy: +python-dev
___
Python tracker
R. David Murray added the comment:
Although this is clearly a bug fix, it also represents a behavior change that
could cause a working program to fail. I have therefore only applied it to
3.4, but I'm open to arguments that it should be backported.
Thanks for the patch, Michael.
--
Kalon Mills added the comment:
Serhiy, sorry I'm not sure I understand your question. But if you take a look
at the script that exhibits the problem I think the bug that I'm reporting
becomes more clear.
Namely, using the dialect configuration shown in the script, the round trip
conversion
Serhiy Storchaka added the comment:
CSV is not well defined format. What you expect to read from csv.reader(['one',
'two'])? If two rows ['one'] and ['two'], than the reader in its own right and
there is no bug which can be fixed.
--
___
Python
Maciej Szulik added the comment:
I've confirmed that bug in the latest repo version, still exists. I attach
patch for py3k.
I'll try to have a look at it in the current version, as soon as it will be
fixed I'll port it to 2.7.
--
nosy: +maciej.szulik
versions: +Python 3.4
Added file:
Changes by Łukasz Langa luk...@langa.pl:
--
assignee: - lukasz.langa
nosy: +lukasz.langa
versions: +Python 3.2, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15927
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15927
___
___
Changes by Chris Jerdonek chris.jerdo...@gmail.com:
--
components: +Library (Lib) -None
title: cvs.reader does not support escaped newline when quoting=cvs.QUOTE_NONE
- csv.reader() does not support escaped newline when quoting=csv.QUOTE_NONE
___
12 matches
Mail list logo