Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18965

Re: SMTPHandler and Unicode

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <chris@simplistix.co.uk>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python': 0.08; 'from:addr:simplistix.co.uk': 0.09; 'from:name:chris withers': 0.09; 'message-id:@simplistix.co.uk': 0.09; 'received:89.151': 0.09; 'received:89.151.125': 0.09; 'received:89.151.125.140': 0.09; 'received:server1.simplistix.co.uk': 0.09; 'received:simplistix.co.uk': 0.09; 'url:github': 0.09; 'cc:addr :python-list': 0.15; 'this:': 0.15; 'codec': 0.16; 'encode': 0.16; 'ordinal': 0.16; 'simplistix': 0.16; 'subject:Unicode': 0.16; 'url:simplistix': 0.16; 'wrote:': 0.16; 'meant': 0.17; 'cheers,': 0.20; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'from:addr:chris': 0.23; 'release:': 0.23; 'cc:2**0': 0.25; 'import': 0.27; 'sorry,': 0.28; 'unicode': 0.28; 'fixed': 0.29; 'problem': 0.29; 'cc:addr:python.org': 0.29; 'chris': 0.30; 'source': 0.32; "can't": 0.32; 'header:User-Agent:1': 0.33; 'character': 0.34; 'but': 0.37; 'received:192': 0.38; 'skip:m 40': 0.38; 'processing': 0.39; 'else': 0.39; 'received:192.168.1': 0.39; 'subject:: ': 0.39; 'url:uk': 0.40; 'your': 0.61; 'url:co': 0.63; 'received:89': 0.65; 'due': 0.66; 'ridiculously': 0.84; '-->': 0.91
Date Sat, 14 Jan 2012 08:25:39 +0000
From Chris Withers <chris@simplistix.co.uk>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version 1.0
To norbert <ncauderan@gmail.com>
Subject Re: SMTPHandler and Unicode
References <6cc17e2c-6560-4bc2-968f-1d23f288dc7c@b35g2000yqi.googlegroups.com> <mailman.256.1278328627.1673.python-list@python.org> <02f2f8f9-e563-4677-97e2-74e91c623853@c10g2000yqi.googlegroups.com> <4F109153.3040409@simplistix.co.uk>
In-Reply-To <4F109153.3040409@simplistix.co.uk>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4740.1326529526.27778.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1326529526 news.xs4all.nl 6885 [2001:888:2000:d::a6]:58396
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18965

Show key headers only | View raw


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='toto@example.com',toaddrs=('toto@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)
>
> It's taken a ridiculously long amount of time (sadly due to no-one else
> complaining) but this is now fixed in the source control for
> mailinglogger, and will be in the next release:
>
> https://github.com/Simplistix/testfixtures

Sorry, I meant this:

https://github.com/Simplistix/mailinglogger/commit/1c95f532c65ab18e1dd8513e1aa1ae328a19d249

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: SMTPHandler and Unicode Chris Withers <chris@simplistix.co.uk> - 2012-01-14 08:25 +0000

csiph-web