[issue17155] logging can raise UnicodeEncodeError

2013-02-20 Thread Kim
Kim added the comment: I'm running into similar issues with 2.6.7 and logging 0.4.9.6, where unicode strings are fine in print statements and codecs writes, but the same string is giving tracebacks for logging. If it's an education issue, I'm not finding the education I need ... :-/ import

[issue17155] logging can raise UnicodeEncodeError

2013-02-20 Thread Kim
Kim added the comment: p.s. Converting to a StreamHandler fixes my issue for now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17155 ___ ___

[issue17155] logging can raise UnicodeEncodeError

2013-02-08 Thread Éric Araujo
Éric Araujo added the comment: Hm the correct way to use exception is: except Something: logger.exception('problem while doing X') i.e. this is a generic unicode-to-str-with-default-encoding problem, not something specific to logging. Vinay, do you think logging should do

[issue17155] logging can raise UnicodeEncodeError

2013-02-08 Thread Vinay Sajip
Vinay Sajip added the comment: It is by design that logging accepts arbitrary objects, rather than just strings, see docs.python.org/howto/logging.html#arbitrary-object-messages and, as documented, the instance's __str__ will be called by logging calling str() on the instance. If people are