Commits

Vinay Sajip committed d3b44ce

Issue #6314: logging.basicConfig() performs extra checks on the "level" argument.

Comments (0)

Files changed (2)

Lib/logging/__init__.py

         root.addHandler(hdlr)
         level = kwargs.get("level")
         if level is not None:
+            if str(level) == level: # If a string was passed, do more checks
+                if level not in _levelNames:
+                    raise ValueError("Unknown level: %r" % level)
+                level = _levelNames[level]
             root.setLevel(level)
 
 #---------------------------------------------------------------------------
 Library
 -------
 
+- Issue #6314: logging.basicConfig() performs extra checks on the "level"
+  argument.
+
 - Issue #6274: Fixed possible file descriptors leak in subprocess.py
 
 - Accessing io.StringIO.buffer now raises an AttributeError instead of
   io.UnsupportedOperation.
 
-- Issue #6271: mmap tried to close invalid file handle (-1) when annonymous.
+- Issue #6271: mmap tried to close invalid file handle (-1) when anonymous.
   (On Unix)