From b9ffb292bf75f3522ba73d2c116c8942302298bf Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 18 Oct 2012 12:06:30 -0400 Subject: [PATCH] rss2email: work around pickle.load() messing with LOG. I'm not sure why this is happening yet, but _pickle.load() is duplicating the StreamHandlers in LOG and resetting the log level to ERROR. Work around that by saving the original level/handlers and restoring them after the load() call. I haven't figured out why this happens yet. --- rss2email.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rss2email.py b/rss2email.py index 886fea5..cd9fb71 100755 --- a/rss2email.py +++ b/rss2email.py @@ -1341,7 +1341,13 @@ class Feeds (list): _fcntl.flock(self._datafile_lock.fileno(), locktype) self.clear() - self.extend(_pickle.load(self._datafile_lock)) + + level = LOG.level + handlers = list(LOG.handlers) + feeds = list(_pickle.load(self._datafile_lock)) + LOG.setLevel(level) + LOG.handlers = handlers + self.extend(feeds) if locktype == 0: self._datafile_lock.close() -- 2.26.2