Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mail notification - encoding exception not catched #1745

Closed
mohierf opened this issue Nov 3, 2015 · 0 comments · Fixed by #1746
Closed

Mail notification - encoding exception not catched #1745

mohierf opened this issue Nov 3, 2015 · 0 comments · Fixed by #1746

Comments

@mohierf
Copy link
Contributor

mohierf commented Nov 3, 2015

When message content is UTF-8 encoded an uncatched exception is raised and the mail notification is not sent. As an example:

./notify_by_email.py -n service -S localhost -r test@localhost -f html -c "PROBLEM,,localhost,,127.0.0.1,,Mon 02 Nov 11:20:09 UTC 2015" -o "Services,,CRITICAL,,CRITICAL - 'Frédéric',,48h 05m 58s"

Traceback (most recent call last):
  File "/var/lib/shinken/libexec/notify_by_email.py", line 370, in <module>
    mail = create_html_message(mail)
  File "/var/lib/shinken/libexec/notify_by_email.py", line 228, in create_html_message
    html_msg = html_content.encode(sys.stdout.encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1783: ordinal not in range(128)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant