Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a9769c2

Browse files
committed
Fix the last remaining test_csv failure.
We were using T_CHAR for a UNICODE character. (This happened to work on x86 most of the time due to endianness; but not on PPC.)
1 parent 75c26bc commit a9769c2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Modules/_csv.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ Dialect_get_lineterminator(DialectObj *self)
185185
return get_string(self->lineterminator);
186186
}
187187

188+
static PyObject *
189+
Dialect_get_delimiter(DialectObj *self)
190+
{
191+
return get_nullchar_as_None(self->delimiter);
192+
}
193+
188194
static PyObject *
189195
Dialect_get_escapechar(DialectObj *self)
190196
{
@@ -292,14 +298,14 @@ dialect_check_quoting(int quoting)
292298
#define D_OFF(x) offsetof(DialectObj, x)
293299

294300
static struct PyMemberDef Dialect_memberlist[] = {
295-
{ "delimiter", T_CHAR, D_OFF(delimiter), READONLY },
296301
{ "skipinitialspace", T_INT, D_OFF(skipinitialspace), READONLY },
297302
{ "doublequote", T_INT, D_OFF(doublequote), READONLY },
298303
{ "strict", T_INT, D_OFF(strict), READONLY },
299304
{ NULL }
300305
};
301306

302307
static PyGetSetDef Dialect_getsetlist[] = {
308+
{ "delimiter", (getter)Dialect_get_delimiter},
303309
{ "escapechar", (getter)Dialect_get_escapechar},
304310
{ "lineterminator", (getter)Dialect_get_lineterminator},
305311
{ "quotechar", (getter)Dialect_get_quotechar},

0 commit comments

Comments
 (0)