[Python-checkins] r73496 - in python/trunk: Lib/logging/__init__.py Misc/NEWS

vinay.sajip python-checkins at python.org
Sun Jun 21 19:37:27 CEST 2009


Author: vinay.sajip
Date: Sun Jun 21 19:37:27 2009
New Revision: 73496

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

Modified:
   python/trunk/Lib/logging/__init__.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Lib/logging/__init__.py
==============================================================================
--- python/trunk/Lib/logging/__init__.py	(original)
+++ python/trunk/Lib/logging/__init__.py	Sun Jun 21 19:37:27 2009
@@ -1397,6 +1397,10 @@
         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)
 
 #---------------------------------------------------------------------------

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Sun Jun 21 19:37:27 2009
@@ -327,7 +327,10 @@
 Library
 -------
 
-- Issue #6164: Added an AIX specific linker argument in Distutils 
+- Issue #6314: logging.basicConfig() performs extra checks on the "level"
+  argument.
+
+- Issue #6164: Added an AIX specific linker argument in Distutils
   unixcompiler. Original patch by Sridhar Ratnakumar.
 
 - Issue #6274: Fixed possible file descriptors leak in subprocess.py


More information about the Python-checkins mailing list