summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2011-11-07 08:43:51 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2011-11-07 08:43:51 (GMT)
commitcaf0272d40f4af95d28797f1ad84b8f641368240 (patch)
treea5279066cbfaeaaa0a22c6397fb60dc8c64d4b94 /Lib/logging
parent5df091a91e1989f79b5684a63c19e3ddabdc2476 (diff)
downloadcpython-caf0272d40f4af95d28797f1ad84b8f641368240.zip
cpython-caf0272d40f4af95d28797f1ad84b8f641368240.tar.gz
cpython-caf0272d40f4af95d28797f1ad84b8f641368240.tar.bz2
Closes #13356. Thanks to Florent Xicluna for the patch.
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/__init__.py2
-rw-r--r--Lib/logging/config.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index b94fbbc..f6af605 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -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:
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index 5af91d4..8e01a56 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -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 + "."