You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that in r69448, the test does not match the code:
codecs.getwriter('cp1251') has no attribute 'encoding', and no function
in test_logging ever pass a stream with an explicit encoding.
Also, the test in emit() should be reversed, otherwise msg.encode() is
called only when msg is a 8bit string. And in this case, a unicode
string should be passed to the stream.
See attached patch.
The codecs.getwriter should probably grow an 'encoding' attribute
automatically, but this is another issue.
Activity
methane commentedon Apr 16, 2009
>>> logging.error(u'あ') ERROR:root:縺・ >>> sys.stderr.encoding 'cp932'This bug is introduced by following commit.
http://svn.python.org/view/python/branches/release26-
maint/Lib/logging/init.py?r1=68830&r2=69448
amauryfa commentedon Apr 16, 2009
I think that in r69448, the test does not match the code:
codecs.getwriter('cp1251') has no attribute 'encoding', and no function
in test_logging ever pass a stream with an explicit encoding.
Also, the test in emit() should be reversed, otherwise msg.encode() is
called only when msg is a 8bit string. And in this case, a unicode
string should be passed to the stream.
See attached patch.
The codecs.getwriter should probably grow an 'encoding' attribute
automatically, but this is another issue.
vsajip commentedon Apr 16, 2009
Fix checked into trunk and release26-maint.