Skip to content

Commit

Permalink
Merge pull request #489 from onyxfish/393
Browse files Browse the repository at this point in the history
Fix #393
  • Loading branch information
James McKinney committed Jan 23, 2016
2 parents 347bf33 + 289bcf4 commit 9deaede
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions csvkit/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ def from_csv(cls, f, name='from_csv_table', snifflimit=None, column_ids=None, bl
width = len(data_columns)

for i, row in enumerate(rows):
j = 0

for j, d in enumerate(row):
try:
data_columns[j].append(row[column_ids[j]].strip())
Expand Down
3 changes: 3 additions & 0 deletions tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ def test_from_csv_no_inference(self):
self.assertEqual(t[3][0], 'True')
self.assertEqual(type(t[3][0]), six.text_type)

def test_from_csv_empty_file(self):
table.Table.from_csv(six.StringIO('\n\n'))

def test_to_csv(self):
with open('examples/testfixed_converted.csv', 'r') as f:
contents = f.read()
Expand Down

0 comments on commit 9deaede

Please sign in to comment.