Skip to content

Commit

Permalink
Issue python#6314: logging.basicConfig() performs extra checks on the…
Browse files Browse the repository at this point in the history
… "level" argument.
  • Loading branch information
vsajip committed Jun 21, 2009
1 parent 2a998fa commit 0f6eac2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Lib/logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

#---------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 0f6eac2

Please sign in to comment.