mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
fix for piping data with non-platform newlines (e.g. windows csv files on unix)
This commit is contained in:
@ -104,6 +104,11 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
for line in itertools.islice(data, 100):
|
||||
temp_list.append(line)
|
||||
|
||||
# if length of temp_list is only 1, then was probably piped in with incorrect newline for the platform
|
||||
# try splitting on lines again:
|
||||
if len(temp_list) == 1:
|
||||
temp_list = temp_list[0].splitlines()
|
||||
|
||||
sniffdata = '\n'.join(temp_list)
|
||||
|
||||
dialect = None
|
||||
|
Reference in New Issue
Block a user