python 2.7: "TypeError: Level not an integer or a valid string: None" from logging code

Bug #682598 reported by Max Kanat-Alexander
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
loggerhead
Fix Released
High
Max Kanat-Alexander

Bug Description

Starting loggerhead throws the following traceback:

Traceback (most recent call last):
  File "./serve-branches", line 30, in <module>
    main(sys.argv[1:])
  File "/home/mkanat/projects/loggerhead-fixes/loggerhead/loggerhead/main.py", line 152, in main
    app = make_app_for_config_and_path(config, path)
  File "/home/mkanat/projects/loggerhead-fixes/loggerhead/loggerhead/main.py", line 106, in make_app_for_config_and_path
    setup_logging(config)
  File "/home/mkanat/projects/loggerhead-fixes/loggerhead/loggerhead/main.py", line 62, in setup_logging
    logging.getLogger('').setLevel(log_level)
  File "/usr/lib64/python2.7/logging/__init__.py", line 1104, in setLevel
    self.level = _checkLevel(level)
  File "/usr/lib64/python2.7/logging/__init__.py", line 190, in _checkLevel
    raise TypeError("Level not an integer or a valid string: %r" % level)
TypeError: Level not an integer or a valid string: None

Related branches

Revision history for this message
Max Kanat-Alexander (mkanat) wrote :

The 1.18 branch is unaffected, only trunk is affected.

Changed in loggerhead:
importance: Undecided → Medium
Revision history for this message
Max Kanat-Alexander (mkanat) wrote :

Okay, the problem is that None is being passed to setLevel. This didn't happen in 1.18 because there was no log-level option. I've added a default to the log-level option (I made the default "info", which also happens to differ from the old "debug" default), which fixes the problem.

Revision history for this message
Max Kanat-Alexander (mkanat) wrote :

I committed without review because this is a one-line, very straightforward change that is blocking my development.

Changed in loggerhead:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in loggerhead:
importance: Medium → High
Changed in loggerhead:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.