Skip to content

Commit 8a66990

Browse files
committed
Changed ietf/utils/mail.py to use unicode strings, and changed a call in ietf/reviv/utils.py to use unicode for mail Subject, to fix a server 500 issue.
- Legacy-Id: 16007
1 parent 1782465 commit 8a66990

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

ietf/review/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright The IETF Trust 2016-2019, All Rights Reserved
3+
from __future__ import unicode_literals, print_function
4+
5+
16
import datetime, re, itertools
27
from collections import defaultdict, namedtuple
38

ietf/utils/mail.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def send_smtp(msg, bcc=None):
117117
raise SMTPSomeRefusedRecipients(message="%d addresses were refused"%len(unhandled),original_msg=msg,refusals=unhandled)
118118
except Exception as e:
119119
# need to improve log message
120-
log("Exception while trying to send email from '%s' to %s subject '%s'" % (frm, to, msg.get('Subject', '[no subject]')))
120+
log(u"Exception while trying to send email from '%s' to %s subject '%s'" % (frm, to, msg.get('Subject', '[no subject]')))
121121
if isinstance(e, smtplib.SMTPException):
122122
e.original_msg=msg
123123
raise
@@ -128,7 +128,7 @@ def send_smtp(msg, bcc=None):
128128
server.quit()
129129
except smtplib.SMTPServerDisconnected:
130130
pass
131-
log("sent email from '%s' to %s id %s subject '%s'" % (frm, to, msg.get('Message-ID', ''), msg.get('Subject', '[no subject]')))
131+
log(u"sent email from '%s' to %s id %s subject '%s'" % (frm, to, msg.get('Message-ID', ''), msg.get('Subject', '[no subject]')))
132132

133133
def copy_email(msg, to, toUser=False, originalBcc=None):
134134
'''

0 commit comments

Comments
 (0)