New submission from Paweł Wroniszewski: The following code reproduces the error:
import logging logging.root.addHandler(logging.FileHandler(filename='test.log',encoding='UTF16')) logging.error( u'b\u0142\u0105d') I think the problem is in the line logging/__init__.py:860: ufs = fs.decode(stream.encoding) as Python can't really handle the following code: fs = "%s\n" print fs.decode('utf16') % u'foo' ---------- components: Library (Lib) messages: 200001 nosy: pwronisz, vinay.sajip priority: normal severity: normal status: open title: Logging to file does not accept UTF16 type: behavior versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19267> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com