Quantcast
Channel: feed2exec:0468b0f013c169566ebd398aeeb6b63f08dcccc0 commits
Viewing all articles
Browse latest Browse all 40

initialize FeedFetcher session singleton properly

$
0
0
without this, the wayback plugin would fail because it FeedFetcher._session is None. doing this in the constructor makes the accessor faster as well, as we don't need to do another check. this should resolve a bug I found in the last run, which we *can't* write unit tests for (because we use betamax in tests, which properly set the class-level session): plugin generated exception: 'NoneType' object has no attribute 'head', skipping Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/feed2exec/plugins/__init__.py", line 96, in output return plugin.output(*args, feed=feed, item=item, lock=lock) File "/usr/local/lib/python3.5/dist-packages/feed2exec/plugins/wayback.py", line 28, in output res = session.head('%s/save/%s' % (WAYBACK_URL, item.get('link'))) AttributeError: 'NoneType' object has no attribute 'head'

Viewing all articles
Browse latest Browse all 40

Trending Articles