When you remove a feed from your config file by hand, you might leave
the dynamic 'seen' data in the JSON data file by accident. If you
have such orphan data, the feed is loaded by Feeds._load_feeds() with
the default configuration (since you removed the config file entry).
This can lead to opmlexport errors like:
Traceback (most recent call last):
File "./r2e", line 5, in <module>
rss2email.main.run()
File "/.../rss2email/rss2email/main.py", line 163, in run
args.func(feeds=feeds, args=args)
File "/.../rss2email/rss2email/command.py", line 157, in opmlexport
url = _saxutils.escape(feed.url)
File "/usr/lib64/python3.2/xml/sax/saxutils.py", line 34, in escape
data = data.replace("&", "&")
AttributeError: 'NoneType' object has no attribute 'replace'
because the feeds lack the per-feed 'url' setting that had been
defined in the config file. With this commit, opmlexport drops these
URL-less feeds, instead of choking to death trying to format them ;).
Signed-off-by: W. Trevor King <wking@tremily.us>
v3.5 (unreleased)
* Fix html2text configuration (ignored since 2012-10-04).
+ * Fix opmlexport crash due to orphaned feed data.
v3.4 (2013-05-14)
* Added post-processing hooks for user-specified message manipulation.
'</head>\n'
'<body>\n')
for feed in feeds:
+ if not feed.url:
+ _LOG.debug('dropping {}'.format(feed))
+ continue
url = _saxutils.escape(feed.url)
f.write('<outline type="rss" text="{0}" xmlUrl="{0}"/>'.format(url))
f.write(