[Twisted-Python] print unicode

Pet petshmidt at googlemail.com
Wed May 5 09:06:57 MDT 2010


On Wed, May 5, 2010 at 4:54 PM, Itamar Turner-Trauring
<itamar at itamarst.org> wrote:
> On Wed, 2010-05-05 at 16:47 +0200, Pet wrote:
>> Now, I'm getting Exception with
>>
>>           File "/usr/local/tw10/lib/python2.5/site-packages/Twisted-10.0.0-py2.5-linux-x86_64.egg/twisted/python/log.py",
>> line 555, in write
>>             d = (self.buf + data).split('\n')
>>         exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte
>> 0xc5 in position 4: ordinal not in range(128)
>
> Are you logging/printing unencoded unicode strings (i.e. type(s) ==
> unicode)? Twisted does not support that.

No, this exception occurs if I do print myunicodestring.encode('UTF-8')
As I said before, it doesn't happen at first request after server restart.

>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>




More information about the Twisted-Python mailing list