Project

General

Profile

« Previous | Next » 

Revision 1660

csvs.py: stream_info(): If header_line == '', set dialect to None rather than trying (and failing) to auto-detect it

View differences:

csvs.py
27 27
    @return NamedTuple {header_line, dialect}'''
28 28
    info = util.NamedTuple()
29 29
    info.header_line = stream.readline()
30
    info.dialect = sniff(info.header_line)
30
    if info.header_line != '': info.dialect = sniff(info.header_line)
31
    else: info.dialect = None # line of '' indicates EOF = empty stream
31 32
    return info
32 33

  
33 34
class TsvReader:

Also available in: Unified diff