kojid: use binary msg for python3 in *Notification tasks

fixes: #1882
This commit is contained in:
Yu Ming Zhu 2019-12-20 07:27:08 +00:00 committed by Tomas Kopecek
parent 0c56cad2b5
commit 8d4a5c7129
2 changed files with 20 additions and 9 deletions

View file

@ -4934,9 +4934,12 @@ Status: %(status)s\r
message = self.message_templ % locals()
# ensure message is in UTF-8
message = koji.fixEncoding(message)
# binary for python3
if six.PY3:
message = message.encode('utf8')
server = smtplib.SMTP(self.options.smtphost)
#server.set_debuglevel(True)
server.sendmail(from_addr, recipients, message)
server.quit()
@ -5143,7 +5146,9 @@ Build Info: %(weburl)s/buildinfo?buildID=%(build_id)i\r
message = self.message_templ % locals()
# ensure message is in UTF-8
message = koji.fixEncoding(message)
# binary for python3
if six.PY3:
message = message.encode('utf8')
server = smtplib.SMTP(self.options.smtphost)
# server.set_debuglevel(True)
server.sendmail(from_addr, recipients, message)