]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Closes #13356. Thanks to Florent Xicluna for the patch.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Mon, 7 Nov 2011 08:43:51 +0000 (08:43 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Mon, 7 Nov 2011 08:43:51 +0000 (08:43 +0000)
Lib/logging/__init__.py
Lib/logging/config.py

index b94fbbcfe35438e35b0992562be9ba738cabddff..f6af6057e6c2b1e133e585e419b4b6536a8925d3 100644 (file)
@@ -1007,6 +1007,8 @@ class Manager(object):
         placeholder to now point to the logger.
         """
         rv = None
+        if isinstance(name, unicode):
+            name = name.encode('utf-8')
         _acquireLock()
         try:
             if name in self.loggerDict:
index 5af91d44c803196f44fae33215727b6d606029b2..8e01a5640285c0b2926291c19ba5d27bee701b28 100644 (file)
@@ -211,7 +211,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(key=_encoded)
+    existing.sort()
     #We'll keep the list of existing loggers
     #which are children of named loggers here...
     child_loggers = []
@@ -589,13 +589,14 @@ class DictConfigurator(BaseConfigurator):
                 #avoid disabling child loggers of explicitly
                 #named loggers. With a sorted list it is easier
                 #to find the child loggers.
-                existing.sort(key=_encoded)
+                existing.sort()
                 #We'll keep the list of existing loggers
                 #which are children of named loggers here...
                 child_loggers = []
                 #now set up the new ones...
                 loggers = config.get('loggers', EMPTY_DICT)
                 for name in loggers:
+                    name = _encoded(name)
                     if name in existing:
                         i = existing.index(name)
                         prefixed = name + "."