On 5 juil, 14:32, Chris Withers <ch...@simplistix.co.uk> wrote: > norbert wrote: > > Your package has the same unicode problem : > > import logging,logging.handlers > > from mailinglogger.MailingLogger import MailingLogger > > mailingLogger = MailingLogger(mailhost=('smtp.example.com', > > 25),fromaddr='t...@example.com',toaddrs=('t...@example.com',)) > > LOG = logging.getLogger() > > LOG.addHandler(mailingLogger) > > LOG.error(u"sans accent") > > LOG.error(u"accentu\u00E9") > > > --> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' > > in position 7: ordinal not in range(128) > > Interesting, I don't know what the logging framework's position is on > unicode... > > What happens when you try the same logging with just a FileHandler > registered? What encoding does the log file use? >
a FileHandler works as expected, the log file being UTF-8 encoded. The SMTPHandler is the only logger I know with this problem, maybe connected to SMTPLib implementation ? -- http://mail.python.org/mailman/listinfo/python-list