gcrahay / otx_misp

Imports Alienvault OTX pulses to a MISP instance
Other
52 stars 42 forks source link

Logging causes create_events to fail on non-ascii pulse names #26

Open griffisc opened 6 years ago

griffisc commented 6 years ago

Description

The line: log.info("## {name} - {date}".format(name=event_name, date=event_date)) in otx_misp\init.py, line 230, causes ascii encoding errors for utf pulse names. changing to: log.info("## {name} - {date}".format(name=event_name.encode('ascii', 'backslashreplace'), date=event_date)) or something similar will fix it

Versions

Traceback or error

  Cannot import pulse Hussarini ΓÇô Targeted Cyber Attack in the Philippines: 'ascii' codec can't encode character u'\u2013' in position 10: ordinal not in range(128)
  ERROR [__init__.py:216 - create_events() ] Cannot import pulse Hussarini ΓÇô Targeted Cyber Attack in the Philippines: ' ascii' codec can't encode character u'\u2013' in position 10: ordinal not in range(128)