This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jdwhitley
Recipients jdwhitley, skip.montanaro
Date 2009-03-09.03:01:02
SpamBayes Score 2.2867927e-05
Marked as misclassified No
Message-id <1236567664.39.0.912806944135.issue5455@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-03-09 03:01:04jdwhitleysetrecipients: + jdwhitley, skip.montanaro
2009-03-09 03:01:04jdwhitleysetmessageid: <1236567664.39.0.912806944135.issue5455@psf.upfronthosting.co.za>
2009-03-09 03:01:03jdwhitleylinkissue5455 messages
2009-03-09 03:01:02jdwhitleycreate