Index: Lib/logging/config.py =================================================================== --- Lib/logging/config.py (revision 82986) +++ Lib/logging/config.py (working copy) @@ -104,6 +104,9 @@ 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 @@ #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 = [] Index: Lib/test/test_logging.py =================================================================== --- Lib/test/test_logging.py (revision 82984) +++ Lib/test/test_logging.py (working copy) @@ -69,6 +69,10 @@ finally: logging._releaseLock() + # Set 2 unused loggers: a non-ASCII logger and a Unicode logger + logging.getLogger("\xab\xd7\xbb") + logging.getLogger(u"\u013f\u00d6\u0047") + self.root_logger = logging.getLogger("") self.original_logging_level = self.root_logger.getEffectiveLevel()