[issue6991] logging encoding failes some situation

Naoki INADA report at bugs.python.org
Fri Sep 25 16:54:41 CEST 2009


Naoki INADA <songofacandy at gmail.com> added the comment:

Please see and execute an attached foo.py.

In Python 2.6.2, this cause following error:
>python foo.py
Traceback (most recent call last):
  File "foo.py", line 3, in <module>
    f.write('\xaa')
  File "C:\usr\Python2.6\lib\codecs.py", line 686, in write
    return self.writer.write(data)
  File "C:\usr\Python2.6\lib\codecs.py", line 351, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xaa in position 0:
ordinal not in ran
ge(128)

----------
status: pending -> open
Added file: http://bugs.python.org/file14971/foo.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6991>
_______________________________________


More information about the Python-bugs-list mailing list