Vinay Sajip <vinay_sa...@yahoo.co.uk> added the comment: It's not about logging - your first example (foo.py) didn't have any logging code in it.
The problem is caused only when someone doesn't understand how Unicode and codecs.open works, and logging can't fix this. The rule is: If you use a stream without encoding and byte strings under Python 2.x, you'll be OK - fine if you're using ASCII or Latin-1. However, users of systems outside this (e.g. CJK or Cyrillic) will not be covered. For use anywhere, you really have to work in Unicode internally, decode stuff on the way in and encode stuff on the way out. That's what the codecs module is for. If third-party libraries which you are using don't use Unicode properly, then they are broken, and logging can't fix that. Any attempt to "paper over the cracks" will fail sooner or later. It's better to identify the problem exactly where it occurs: Python's Zen says "Errors should never pass silently." I'm closing this issue, as it's not really logging-related. Hope that's OK. ---------- resolution: -> invalid status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6991> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com