New submission from Kuno <k...@frob.nl>:

When attempting to use the encoding="" parameter of logging.FileHandler
I always get a UnicodeError.  This looks like a bug to me (otherwise I
am seriously misunderstanding what the parameter is supposed to do). The
attached file contains the code to reproduce this error.

Traceback (most recent call last):
  File "/usr/local/stow/Python-2.6.1/lib/python2.6/logging/__init__.py",
line 765, in emit
    self.stream.write(fs % msg.encode("UTF-8"))
  File "/usr/local/stow/Python-2.6.1/lib/python2.6/codecs.py", line 686,
in write
    return self.writer.write(data)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xec in position 0:
ordinal not in range(128)

For completeness:  I am running a self-compiled Python 2.6.1 on the
current Debian GNU/Linux testing release.

----------
components: Library (Lib)
files: l.py
messages: 85106
nosy: warp
severity: normal
status: open
title: logging.FileHandler encoding parameter does not work as expected
versions: Python 2.6
Added file: http://bugs.python.org/file13562/l.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5659>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to