[issue5170] logging to file + encoding

shamilbi report at bugs.python.org
Fri Feb 6 17:07:47 CET 2009


New submission from shamilbi <shamilbi at gmail.com>:

if i configure logging into a file with encoding = 'cp1251' and do
logger.debug(u'...') then i get crash with UnicodeError

i suggest reimplementing method FileHandler.emit():
...
if isinstance(msg, unicode):
    stream.write(f % msg)    # it works!
...

----------
components: Library (Lib)
messages: 81274
nosy: shamilbi
severity: normal
status: open
title: logging to file + encoding
type: crash
versions: Python 2.6

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


More information about the Python-bugs-list mailing list