Project

General

Profile

« Previous | Next » 

Revision 3055

csvs.py: TsvReader: Prevent "new-line character seen in unquoted field" errors by replacing '\r' with '\n'

View differences:

lib/csvs.py
59 59
            record += contents
60 60
            if len(contents) == len(raw_contents): break # no line continuation
61 61
            record += ending_placeholder
62
        
63
        # Prevent "new-line character seen in unquoted field" errors
64
        record = record.replace('\r', ending_placeholder)
65
        
62 66
        row = csv.reader(StringIO.StringIO(record), self.dialect).next()
63 67
        return [v.replace(ending_placeholder, '\n') for v in row]
64 68

  

Also available in: Unified diff