This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author simon04
Recipients cjw296, norbidur, r.david.murray, simon04, vinay.sajip
Date 2015-10-13.13:09:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1444741750.52.0.579933593501.issue9208@psf.upfronthosting.co.za>
In-reply-to
Content
I don't see why/how this should be fixed in Python 3.

Using the example from msg109621 and Python 3.5.0, I get:
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.5/logging/handlers.py", line 985, in emit
    smtp.sendmail(self.fromaddr, self.toaddrs, msg)
  File "/usr/lib/python3.5/smtplib.py", line 846, in sendmail
    msg = _fix_eols(msg).encode('ascii')
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 108: ordinal not in range(128)
Call stack:
  File "/tmp/x.py", line 8, in <module>
    LOG.error(u"accentu\u00E9")
Message: 'accentué'
Arguments: ()

The problem is that an SMTP message is constructed and non-ASCII characters are not escaped in SMTPHandler.emit. A robust fix would be to use email.mime.text.MIMEText instead:

msg = MIMEText(msg)
msg['Subject'] = self.getSubject(record)
msg['From'] = self.fromaddr
msg['To'] = ",".join(self.toaddrs)
History
Date User Action Args
2015-10-13 13:09:10simon04setrecipients: + simon04, vinay.sajip, norbidur, cjw296, r.david.murray
2015-10-13 13:09:10simon04setmessageid: <1444741750.52.0.579933593501.issue9208@psf.upfronthosting.co.za>
2015-10-13 13:09:10simon04linkissue9208 messages
2015-10-13 13:09:10simon04create