Hi Norbert,
On 05/07/2010 13:22, norbert wrote:
On 5 juil, 13:17, Chris Withersch...@simplistix.co.uk wrote:
try MailingLogger:
If you have unicode problems with that, I'd be interested in fixing them!
Your package has the same unicode problem :
import logging,logging.handlers
from
On 13/01/2012 20:17, Chris Withers 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',))
Well, you could use an approach like the one suggested here:
http://plumberjack.blogspot.com/2010/07/using-custom-formatter-to-dea...
That's nice, thanks. I'll use something like this. Just a thought : I
will use errors=replace in the call to the encode method to be sure
that the logger does
On Jul 5, 2:35 pm, Antoine Pitrou solip...@pitrou.net wrote:
a FileHandler works as expected, the log file being UTF-8 encoded.
Ouch. Implicit encoding sounds like a bad behaviour.
UTF-8 is only used as a fallback in an exception handler, you can use
any supported encoding using the encoding=
norbert ncauderan at gmail.com writes:
crash with a UnicodeError. I can't see any workaround, except by
subclassing SMTPHandler's emit method to be unicode-aware or at least
URF-8 aware.
Well, you could use an approach like the one suggested here:
norbert wrote:
I want to send error messages with SMTPHandler logging. But
SMTPHandler does not seem to be unicode aware. Is there something
doable without playing with sys.setdefaultencoding ?
try MailingLogger:
http://www.simplistix.co.uk/software/python/mailinglogger
If you have unicode
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()
On 5 juil, 13:17, Chris Withers ch...@simplistix.co.uk wrote:
try MailingLogger:
If you have unicode problems with that, I'd be interested in fixing them!
Your package has the same unicode problem :
import logging,logging.handlers
from mailinglogger.MailingLogger import MailingLogger
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',
On Mon, 5 Jul 2010 06:17:38 -0700 (PDT)
norbert ncaude...@gmail.com wrote:
a FileHandler works as expected, the log file being UTF-8 encoded.
Ouch. Implicit encoding sounds like a bad behaviour.
The
SMTPHandler is the only logger I know with this problem, maybe
connected to SMTPLib
Antoine Pitrou wrote:
On Mon, 5 Jul 2010 06:17:38 -0700 (PDT)
norbert ncaude...@gmail.com wrote:
a FileHandler works as expected, the log file being UTF-8 encoded.
Ouch. Implicit encoding sounds like a bad behaviour.
Yes indeed, hence my question on python-dev...
Chris
--
Simplistix -
Ouch. Implicit encoding sounds like a bad behaviour.
Looking at the FileHandler source (
http://svn.python.org/view/python/trunk/Lib/logging/__init__.py?view=markup
) : the utf-8 encoding is a fallback. But *FileHandler family let you
specify the encoding you want, so that's OK I think.
But
12 matches
Mail list logo