diff options
author | Martin Hertz <mvhertz@gmail.com> | 2022-05-06 20:51:20 +0200 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2022-05-17 22:42:05 +0100 |
commit | ee3180fd94bf47ccf2dc95e10d716c8080a4ea71 (patch) | |
tree | 878e3d4927d890b0428e43081141c5d1855abc07 /deluge | |
parent | 47e548fdb5fed54a8e607ece81ad9f862d96b64a (diff) | |
download | deluge-ee3180fd94bf47ccf2dc95e10d716c8080a4ea71.tar.gz deluge-ee3180fd94bf47ccf2dc95e10d716c8080a4ea71.tar.bz2 deluge-ee3180fd94bf47ccf2dc95e10d716c8080a4ea71.zip |
[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
Diffstat (limited to 'deluge')
-rw-r--r-- | deluge/plugins/Notifications/deluge_notifications/core.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/deluge/plugins/Notifications/deluge_notifications/core.py b/deluge/plugins/Notifications/deluge_notifications/core.py index d48d449ba..aa200f9bd 100644 --- a/deluge/plugins/Notifications/deluge_notifications/core.py +++ b/deluge/plugins/Notifications/deluge_notifications/core.py @@ -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 |