MISP / PyMISP

Python library using the MISP Rest API
Other
440 stars 278 forks source link

Adding mail flag to stats_report.py results in Unicode error #1065

Open dwe2e opened 1 year ago

dwe2e commented 1 year ago

When calling stats.py, works fine with the date parameters, when adding the mail (-m) flag, results in the following error:

Traceback (most recent call last): File "/var/www/MISP/PyMISP/examples/stats_report.py", line 405, in print_report(report_body, attachments, smtp_from, smtp_to, smtp_server, misp_url) File "/var/www/MISP/PyMISP/examples/stats_report.py", line 312, in print_report server.sendmail(smtp_from, smtp_to, msg.as_string()) File "/usr/lib/python3.10/smtplib.py", line 875, in sendmail msg = _fix_eols(msg).encode('ascii') UnicodeEncodeError: 'ascii' codec can't encode characters in position 143201-143203: ordinal not in range(128)

Rafiot commented 11 months ago

Just making sure, which version or python are you using?