title: How does logging handler become a str?
body: <p>I have a logger that functions properly at the start of a script, then breaks in the middle. It looks like its handler is getting overwritten by a str, but I can't figure out where. </p>
  
  <p>At the start of the script, I'm printing the handler and its level. The following code: </p>
  
  <pre><code>print 'Array of handlers', logger.handlers
      for h in logger.handlers:
          print 'Handler', h
          print 'Handler level', h.level
  </code></pre>
  
  <p>produces this: </p>
  
  <pre><code>Array of handlers [&lt;logging.FileHandler instance at 0x19ef320&gt;]
  Handler &lt;logging.FileHandler instance at 0x19ef320&gt;
  Handler level 0
  </code></pre>
  
  <p>Now in the middle of execution, you'll see that the logger's handler (<strong>hdlr</strong>) is interpreted as a <em>str</em>. </p>
  
  <pre><code>Started from &lt;class 'mymodule.ext.freebase.HTTPMetawebSession'&gt;.
  Traceback (most recent call last):
    File "hadoop/get_web_data.py", line 144, in &lt;module&gt;
      main()
    File "hadoop/get_web_data.py", line 121, in main
      for count, performer in enumerate(results):
    File "/home/wraith/dev/modules/mymodule/ext/freebase.py", line 126, in mqlreaditer
      r = self._httpreq_json(service, 'POST', form=dict(query=qstr))
    File "/home/wraith/dev/modules/mymodule/contrib/freebase/api/session.py", line 369, in _httpreq_json
      resp, body = self._httpreq(*args, **kws)
    File "/home/wraith/dev/modules/mymodule/contrib/freebase/api/session.py", line 346, in _httpreq
      self.log.info('%s %s%s%s', method, url, formstr, headerstr)
    File "/usr/lib/python2.5/logging/__init__.py", line 985, in info
      apply(self._log, (INFO, msg, args), kwargs)
    File "/usr/lib/python2.5/logging/__init__.py", line 1101, in _log
      self.handle(record)
    File "/usr/lib/python2.5/logging/__init__.py", line 1111, in handle
      self.callHandlers(record)
    File "/usr/lib/python2.5/logging/__init__.py", line 1147, in callHandlers
      if record.levelno &gt;= hdlr.level:
  AttributeError: 'str' object has no attribute 'level'
  </code></pre>
  
  <p>In the last 2 lines, <strong>hdlr.level</strong> blows up because <strong>hdlr</strong> is not a <em>str</em>. </p>
  
  <pre><code>if record.levelno &gt;= hdlr.level:
  AttributeError: 'str' object has no attribute 'level'
  </code></pre>
  
  <p>After setting the handler at the beginning, which is fine, I do not add another handler or alter the existing in any way. The only command I call on <strong>logger</strong> is <code>logger.info('event to log')</code>. </p>
  
  <p>What would alter the <strong>logger's handler</strong> in this way? </p>