Jervis Whitley <jervi...@gmail.com> added the comment:

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.

----------
message_count: 1.0 -> 2.0

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5455>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to