[Python-checkins] cpython (2.7): Closes #13356. Thanks to Florent Xicluna for the patch.

vinay.sajip python-checkins at python.org
Mon Nov 7 09:55:02 CET 2011


http://hg.python.org/cpython/rev/8726ad774cf0
changeset:   73414:8726ad774cf0
branch:      2.7
parent:      73412:0b779988e8b7
user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
date:        Mon Nov 07 08:43:51 2011 +0000
summary:
  Closes #13356. Thanks to Florent Xicluna for the patch.

files:
  Lib/logging/__init__.py |  2 ++
  Lib/logging/config.py   |  5 +++--
  2 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -1007,6 +1007,8 @@
         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:
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -211,7 +211,7 @@
     #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 @@
                 #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 + "."

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list