diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2009-06-21 17:46:49 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2009-06-21 17:46:49 (GMT) |
commit | 0f6eac2ad209157444e30f01dfd53f084332e3d8 (patch) | |
tree | c567014bf351c46280badd18315d46dc05f54a99 | |
parent | 2a998fabec10f4b0dad9e94d781fead870053105 (diff) | |
download | cpython-0f6eac2ad209157444e30f01dfd53f084332e3d8.zip cpython-0f6eac2ad209157444e30f01dfd53f084332e3d8.tar.gz cpython-0f6eac2ad209157444e30f01dfd53f084332e3d8.tar.bz2 |
Issue #6314: logging.basicConfig() performs extra checks on the "level" argument.
-rw-r--r-- | Lib/logging/__init__.py | 4 | ||||
-rw-r--r-- | Misc/NEWS | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 9780c83..f932110 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -1396,6 +1396,10 @@ def basicConfig(**kwargs): 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) #--------------------------------------------------------------------------- @@ -15,12 +15,15 @@ Core and Builtins 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) |