[Python-3000-checkins] r56815 - python/branches/py3k-struni/Modules/_csv.c

guido.van.rossum python-3000-checkins at python.org
Wed Aug 8 01:59:30 CEST 2007


Author: guido.van.rossum
Date: Wed Aug  8 01:59:30 2007
New Revision: 56815

Modified:
   python/branches/py3k-struni/Modules/_csv.c
Log:
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.)


Modified: python/branches/py3k-struni/Modules/_csv.c
==============================================================================
--- python/branches/py3k-struni/Modules/_csv.c	(original)
+++ python/branches/py3k-struni/Modules/_csv.c	Wed Aug  8 01:59:30 2007
@@ -186,6 +186,12 @@
 }
 
 static PyObject *
+Dialect_get_delimiter(DialectObj *self)
+{
+        return get_nullchar_as_None(self->delimiter);
+}
+
+static PyObject *
 Dialect_get_escapechar(DialectObj *self)
 {
         return get_nullchar_as_None(self->escapechar);
@@ -292,7 +298,6 @@
 #define D_OFF(x) offsetof(DialectObj, x)
 
 static struct PyMemberDef Dialect_memberlist[] = {
-	{ "delimiter",          T_CHAR, D_OFF(delimiter), READONLY },
 	{ "skipinitialspace",   T_INT, D_OFF(skipinitialspace), READONLY },
 	{ "doublequote",        T_INT, D_OFF(doublequote), READONLY },
 	{ "strict",             T_INT, D_OFF(strict), READONLY },
@@ -300,6 +305,7 @@
 };
 
 static PyGetSetDef Dialect_getsetlist[] = {
+	{ "delimiter",          (getter)Dialect_get_delimiter},
 	{ "escapechar",		(getter)Dialect_get_escapechar},
 	{ "lineterminator",	(getter)Dialect_get_lineterminator},
 	{ "quotechar",		(getter)Dialect_get_quotechar},


More information about the Python-3000-checkins mailing list