From: W. Trevor King Date: Thu, 18 Oct 2012 16:06:30 +0000 (-0400) Subject: rss2email: work around pickle.load() messing with LOG. X-Git-Tag: v3.0~72^2~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b9ffb292bf75f3522ba73d2c116c8942302298bf;p=rss2email.git 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. --- 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()