diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-07-20 20:18:14 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-07-20 20:18:14 (GMT) |
commit | 8a435c472987b230bd1164037c9f9a192df98d4d (patch) | |
tree | 53e94c43e6b677f9d393f30d2931de89b227e61c /Lib/logging | |
parent | ae7dd8fab0d49dd3e1cf71ae64ec8a386cf2061c (diff) | |
download | cpython-8a435c472987b230bd1164037c9f9a192df98d4d.zip cpython-8a435c472987b230bd1164037c9f9a192df98d4d.tar.gz cpython-8a435c472987b230bd1164037c9f9a192df98d4d.tar.bz2 |
Fixed #9310: backported logging fix from 2.7.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/config.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py index 3017ae9..eb2c248 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -104,6 +104,9 @@ def _resolve(name): def _strip_spaces(alist): return map(lambda x: string.strip(x), alist) +def _encoded(s): + return s if isinstance(s, str) else s.encode('utf-8') + def _create_formatters(cp): """Create and return formatters""" flist = cp.get("formatters", "keys") @@ -214,7 +217,7 @@ def _install_loggers(cp, handlers, disable_existing_loggers): #avoid disabling child loggers of explicitly #named loggers. With a sorted list it is easier #to find the child loggers. - existing.sort() + existing.sort(key=_encoded) #We'll keep the list of existing loggers #which are children of named loggers here... child_loggers = [] |