Message109621
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. |
|
Date |
User |
Action |
Args |
2010-07-08 22:16:11 | norbidur | set | recipients:
+ norbidur |
2010-07-08 22:16:11 | norbidur | set | messageid: <1278627371.74.0.0567748809415.issue9208@psf.upfronthosting.co.za> |
2010-07-08 22:16:01 | norbidur | link | issue9208 messages |
2010-07-08 22:16:00 | norbidur | create | |
|