csvdedupe icon indicating copy to clipboard operation
csvdedupe copied to clipboard

Error writing CSV results

Open brianantonelli opened this issue 6 years ago • 1 comments

After training and running I get the following error when it tries to write the results:

INFO:root:# duplicate sets 26051
Traceback (most recent call last):
  File "/usr/local/bin/csvlink", line 11, in <module>
    sys.exit(launch_new_instance())
  File "/usr/local/lib/python2.7/site-packages/csvdedupe/csvlink.py", line 210, in launch_new_instance
    d.main()
  File "/usr/local/lib/python2.7/site-packages/csvdedupe/csvlink.py", line 172, in main
    with open(self.output_file, 'wb', encoding='utf-8') as output_file:
ValueError: binary mode doesn't take an encoding argument

Command:

$ csvlink data/owners.csv data/sellers.csv \
     --field_names_1 ownername city state \
     --field_names_2 name city state \
     --output_file data/output.csv

brianantonelli avatar Jul 13 '18 20:07 brianantonelli

Dropping the encoding argument from csvlink.py line 172 fixes the issue:

with open(self.output_file, 'wb') as output_file:

brianantonelli avatar Jul 16 '18 15:07 brianantonelli