CiscoPSIRT / openVulnAPI

Documentation and Tools for Cisco's PSIRT openVuln API
https://developer.cisco.com/psirt/
MIT License
102 stars 51 forks source link

openVulnQuery client: error in csv function due to special character encoding #28

Closed santosomar closed 7 years ago

santosomar commented 7 years ago

Getting the following error in csv function due to special character encoding.

root@psirt-saint:~# openVulnQuery --cvrf --all --csv all.csv
Traceback (most recent call last):
  File "/usr/local/bin/openVulnQuery", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/openVulnQuery/main.py", line 156, in main
    utils.output(returned_output, output_format, f)
  File "/usr/local/lib/python2.7/dist-packages/openVulnQuery/utils.py", line 53, in output
    _to_csv(advisories, file_handle, delimiter=",")
  File "/usr/local/lib/python2.7/dist-packages/openVulnQuery/utils.py", line 85, in _to_csv
    w.writerow(_convert_list_to_string(advisory))
  File "/usr/lib/python2.7/csv.py", line 152, in writerow
    return self.writer.writerow(self._dict_to_list(rowdict))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 172: ordinal not in range(128)
santosomar commented 7 years ago

After reinstalling the latest version of the openVulnQuery client via pip, the issue has been resolved.