Message83351
in _csv.c, the check is done here:
lineobj = PyIter_Next(self->input_iter);
if (lineobj == NULL) {
/* End of input OR exception */
if (!PyErr_Occurred() && self->field_len != 0)
PyErr_Format(error_obj,
"newline inside string");
return NULL;
}
if (!PyUnicode_Check(lineobj)) {
PyErr_Format(error_obj,
"iterator should return strings, "
"not %.200s "
"(did you open the file in text mode?)",
lineobj->ob_type->tp_name
);
Py_DECREF(lineobj);
return NULL;
}
So the returned lineobj is a bytes type and then the PyUnicode_Check
throws the error. |
|
Date |
User |
Action |
Args |
2009-03-09 03:01:04 | jdwhitley | set | recipients:
+ jdwhitley, skip.montanaro |
2009-03-09 03:01:04 | jdwhitley | set | messageid: <1236567664.39.0.912806944135.issue5455@psf.upfronthosting.co.za> |
2009-03-09 03:01:03 | jdwhitley | link | issue5455 messages |
2009-03-09 03:01:02 | jdwhitley | create | |
|