[Notifications] Fix UnicodeEncodeError upon non-ascii torrent name
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: https://github.com/deluge-torrent/deluge/pull/383
This commit is contained in:
parent
47e548fdb5
commit
ee3180fd94
|
@ -148,7 +148,7 @@ Date: %(date)s
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue