logging of strings with broken encoding

Lie Ryan lie.1296 at gmail.com
Thu Jul 2 11:49:46 EDT 2009


Thomas Guettler wrote:
> Hi,
> 
> I have bug in my code, which results in the same error has this one:
> 
> https://bugs.launchpad.net/bzr/+bug/295653
> {{{
> Traceback (most recent call last):
>   File "/usr/lib/python2.6/logging/__init__.py", line 765, in emit
>     self.stream.write(fs % msg.encode("UTF-8"))
>   ..
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 8: ordinal not in range(128)
> }}}

What's the encoding of self.stream? Is it sys.stdout/sys.stderr or a
file object?



More information about the Python-list mailing list