[Python-checkins] python/nondist/sandbox/csv _csv.c,1.4,1.5
davecole@users.sourceforge.net
davecole@users.sourceforge.net
Sun, 02 Feb 2003 02:02:42 -0800
Update of /cvsroot/python/python/nondist/sandbox/csv
In directory sc8-pr-cvs1:/tmp/cvs-serv10998
Modified Files:
_csv.c
Log Message:
Change comments which refer to "MS double quote" to doublequote.
Fixed stupid bug (introduced while porting Object Craft module) where
p.join(['ab"cdef"h']) did not obey doublequote.
Fixed PyArg_ParseTupleAndKeywords() type character for lineterminator -
was 's', should have been 'O'.
Index: _csv.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/csv/_csv.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** _csv.c 30 Jan 2003 13:36:06 -0000 1.4
--- _csv.c 2 Feb 2003 10:02:40 -0000 1.5
***************
*** 212,216 ****
else if (c == self->quotechar) {
if (self->doublequote) {
! /* microsoft style double quotes; " represented by "" */
self->state = QUOTE_IN_QUOTED_FIELD;
}
--- 212,216 ----
else if (c == self->quotechar) {
if (self->doublequote) {
! /* doublequote; " represented by "" */
self->state = QUOTE_IN_QUOTED_FIELD;
}
***************
*** 235,239 ****
case QUOTE_IN_QUOTED_FIELD:
! /* microsoft double quotes - seen a quote in an quoted field */
if (self->have_quotechar && c == self->quotechar) {
/* save "" as " */
--- 235,239 ----
case QUOTE_IN_QUOTED_FIELD:
! /* doublequote - seen a quote in an quoted field */
if (self->have_quotechar && c == self->quotechar) {
/* save "" as " */
***************
*** 404,411 ****
if (c == '\0')
break;
! /* If in MS double quote mode we escape quote chars with a
* quote.
*/
! if (c == self->have_quotechar && self->doublequote) {
if (copy_phase)
self->rec[rec_len] = self->quotechar;
--- 404,412 ----
if (c == '\0')
break;
! /* If in doublequote mode we escape quote chars with a
* quote.
*/
! if (self->have_quotechar
! && c == self->quotechar && self->doublequote) {
if (copy_phase)
self->rec[rec_len] = self->quotechar;
***************
*** 774,778 ****
quotechar = escapechar = NULL;
! if (PyArg_ParseTupleAndKeywords(args, keyword_args, "|OcOisiiii",
keywords,
"echar, &self->delimiter,
--- 775,779 ----
quotechar = escapechar = NULL;
! if (PyArg_ParseTupleAndKeywords(args, keyword_args, "|OcOiOiiii",
keywords,
"echar, &self->delimiter,