PyMISP icon indicating copy to clipboard operation
PyMISP copied to clipboard

Adding mail flag to stats_report.py results in Unicode error

Open dwe2e opened this issue 2 years ago • 1 comments

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)

dwe2e avatar Sep 21 '23 12:09 dwe2e

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

Rafiot avatar Oct 20 '23 12:10 Rafiot