Obtain the raw line of text read by CSVDictReader when reporting errors?

Malcolm Greene python at bdurham.com
Wed Sep 21 16:28:35 EDT 2016


Looking for ideas on how I can obtain the raw line of text read by a
CSVDictReader. I've reviewed the CSV DictReader documentation and there
are no public attributes that expose this type of data.

My use case is reporting malformed lines detected when my code
validates the dict of data returned by this object. I would like to log
the actual line read by the CSVDictReader, not the processed data
returned in the dict.

Thank you,
Malcolm



More information about the Python-list mailing list