Skip to content

Commit

Permalink
[Notifications] Fix UnicodeEncodeError upon non-ascii torrent name
Browse files Browse the repository at this point in the history
smtplib.SMTP.sendmail expects 'msg' in string of ascii chars or bytes,
where the former gets encoded to bytes through ascii codec, hence
raising said error, but now fixed by encoding to bytes ourself through
utf-8

Closes: #383
  • Loading branch information
mhertz authored and cas-- committed May 17, 2022
1 parent 47e548f commit ee3180f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deluge/plugins/Notifications/deluge_notifications/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _notify_email(self, subject='', message=''):

try:
try:
server.sendmail(self.config['smtp_from'], to_addrs, message)
server.sendmail(self.config['smtp_from'], to_addrs, message.encode())
except smtplib.SMTPException as ex:
err_msg = (
_('There was an error sending the notification email: %s') % ex
Expand Down

0 comments on commit ee3180f

Please sign in to comment.