Skip to content

Commit

Permalink
in2csv CSV-to-CSV conversion respects --linenumbers when buffering
Browse files Browse the repository at this point in the history
  • Loading branch information
James McKinney committed Jan 2, 2019
1 parent 6104510 commit 7894d65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Fixes:
* :doc:`/scripts/csvsql` supports UPDATE commands.
* :doc:`/scripts/csvstat` no longer errors on non-finite numbers.
* :doc:`/scripts/csvstat` respects all command-line arguments when :code:`--count` is set.
* :doc:`/scripts/in2csv` CSV-to-CSV conversion respects :code:`--linenumbers` when buffering.
* :doc:`/scripts/in2csv` writes XLS sheets without encoding errors in Python 2.

1.0.3 - March 11, 2018
Expand Down
4 changes: 2 additions & 2 deletions csvkit/utilities/in2csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def main(self):
if not hasattr(self.input_file, 'name'):
raise ValueError('DBF files can not be converted from stdin. You must pass a filename.')
table = agate.Table.from_dbf(self.input_file.name, **kwargs)
table.to_csv(self.output_file)
table.to_csv(self.output_file, **self.writer_kwargs)

if self.args.write_sheets:
# Close and re-open the file, as the file object has been mutated or closed.
Expand All @@ -171,7 +171,7 @@ def main(self):
base = splitext(self.input_file.name)[0]
for i, table in enumerate(tables.values()):
with open('%s_%d.csv' % (base, i), 'w') as f:
table.to_csv(f)
table.to_csv(f, **self.writer_kwargs)

self.input_file.close()

Expand Down

0 comments on commit 7894d65

Please sign in to comment.