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 norbidur
Recipients norbidur
Date 2010-07-08.22:16:00
SpamBayes Score 0.007847753
Marked as misclassified No
Message-id <1278627371.74.0.0567748809415.issue9208@psf.upfronthosting.co.za>
In-reply-to
Content
SMTPHandler fails when receiving unicode strings.

example : 
import logging,logging.handlers
smtpHandler = logging.handlers.SMTPHandler(
    mailhost=("smtp.free.fr",25),
    fromaddr="from@free.fr", toaddrs="to@free.fr",
    subject=u"error message")
LOG = logging.getLogger()
LOG.addHandler(smtpHandler)
LOG.error(u"accentu\u00E9")

-> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 108 : ordinal not in range(128)

There has been a discuss on this in http://groups.google.com/group/comp.lang.python/browse_thread/thread/759df42f9374d1b6/05ad55c388c746e3?lnk=raot&pli=1

FileHandler does not behave the same way : for this handler's family an encoding can be specified, and if this encoding fails, there is a fallback to UTF-8.
History
Date User Action Args
2010-07-08 22:16:11norbidursetrecipients: + norbidur
2010-07-08 22:16:11norbidursetmessageid: <1278627371.74.0.0567748809415.issue9208@psf.upfronthosting.co.za>
2010-07-08 22:16:01norbidurlinkissue9208 messages
2010-07-08 22:16:00norbidurcreate