From: W. Trevor King Date: Thu, 31 Jan 2013 23:39:48 +0000 (-0500) Subject: util:wsgi: Don't clobber `handler` when clearing StreamHandlers X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ec2f5d26bc84a93feef9c31fb06486b50a59b14a;p=be.git util:wsgi: Don't clobber `handler` when clearing StreamHandlers This bug was introduced in: commit 400c9251eedbd1caa3b28135b4bc5d2bf2124ac5 Author: W. Trevor King Date: Thu Jan 24 02:43:53 2013 -0500 util:wsgi: If we're logging to a file, shift libbe.LOG too where the removed handlers clobbered our initial TimedRotatingFileHandler. --- diff --git a/libbe/util/wsgi.py b/libbe/util/wsgi.py index b731ec8..dcddcf3 100644 --- a/libbe/util/wsgi.py +++ b/libbe/util/wsgi.py @@ -688,8 +688,8 @@ class ServerCommand (libbe.command.base.Command): path, when='w6', interval=1, backupCount=4, encoding=libbe.util.encoding.get_text_file_encoding()) while libbe.LOG.handlers: - handler = libbe.LOG.handlers[0] - libbe.LOG.removeHandler(handler) + h = libbe.LOG.handlers[0] + libbe.LOG.removeHandler(h) libbe.LOG.addHandler(handler) else: handler = logging.StreamHandler(self.stdout)