def release(self): """ Release file and thread locks. """ try: if self.stream_lock and not self.stream_lock.closed: unlock(self.stream_lock) except Exception: pass finally: # release thread lock BaseRotatingHandler.release(self)