commit | f537702732f9107da701794782bb9f037edb1200 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Sun Dec 11 22:31:09 2011 -0800 |
committer | Raymond Hettinger <python@rcn.com> | Sun Dec 11 22:31:09 2011 -0800 |
tree | 95b6bbb3d46b2d218864f2d4305a628c0fecff46 | |
parent | 8b59c23a54a053673c07c6939cccef096d856103 [diff] |
Issue #13573: The csv.writer now uses the repr() for floats rather than str().
diff --git a/Modules/_csv.c b/Modules/_csv.c index 983f6a5..ea3add2 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c
@@ -1184,7 +1184,11 @@ else { PyObject *str; - str = PyObject_Str(field); + if (PyFloat_Check(field)) { + str = PyObject_Repr(field); + } else { + str = PyObject_Str(field); + } Py_DECREF(field); if (str == NULL) return NULL;