From 4ff5e725f29afb3995ff39a0908c7fa3eb085c19 Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Wed, 26 Jun 2013 11:43:00 +1000 Subject: [PATCH 3/3] don't release stream lock if already closed Python 2.7 calls acquire/release around flush+close in logging.shutdown, so ConcurrentLogHandler needs to deal with that. diff --git a/src/cloghandler.py b/src/cloghandler.py index 6a09c7d..d0e82f1 100644 --- a/src/cloghandler.py +++ b/src/cloghandler.py @@ -199,7 +199,8 @@ class ConcurrentRotatingFileHandler(BaseRotatingHandler): self.handleError(None) finally: try: - unlock(self.stream_lock) + if not self.stream_lock.closed: + unlock(self.stream_lock) finally: # release thread lock Handler.release(self) -- 1.8.1.4