Closes #13661: Check added for type of logger name.
This commit is contained in:
parent
caf0272d40
commit
74ab3440ba
|
@ -1007,6 +1007,8 @@ class Manager(object):
|
|||
placeholder to now point to the logger.
|
||||
"""
|
||||
rv = None
|
||||
if not isinstance(name, basestring):
|
||||
raise ValueError('A logger name must be string or Unicode')
|
||||
if isinstance(name, unicode):
|
||||
name = name.encode('utf-8')
|
||||
_acquireLock()
|
||||
|
|
|
@ -272,6 +272,8 @@ class BuiltinLevelsTest(BaseTest):
|
|||
('INF.BADPARENT', 'INFO', '4'),
|
||||
])
|
||||
|
||||
def test_invalid_name(self):
|
||||
self.assertRaises(ValueError, logging.getLogger, any)
|
||||
|
||||
class BasicFilterTest(BaseTest):
|
||||
|
||||
|
|
Loading…
Reference in New Issue