Project

General

Profile

« Previous | Next » 

Revision 8071

csvs.py: TsvReader.next(): Fixed bug where empty line needs to be separately returned as [], because csv.reader would interpret it as EOF since the line ending has already been removed

View differences:

csvs.py
87 87
        record = record.replace('\r', ending_placeholder)
88 88
        
89 89
        # Split line
90
        if len(self.dialect.delimiter) > 1: # multi-char delims
90
        if record == '': row = [] # csv.reader would interpret as EOF
91
        elif len(self.dialect.delimiter) > 1: # multi-char delims
91 92
            row = record.split(self.dialect.delimiter)
92 93
        else: row = csv.reader(StringIO.StringIO(record), self.dialect).next()
93 94
        

Also available in: Unified diff