From ec2f5d26bc84a93feef9c31fb06486b50a59b14a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 31 Jan 2013 18:39:48 -0500 Subject: [PATCH] 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. --- libbe/util/wsgi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.26.2