Skip to content
This repository was archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
bugfix KeyError in hackernews.py (bad rss result)
Browse files Browse the repository at this point in the history
  • Loading branch information
jquast committed Feb 15, 2015
1 parent 11da63f commit b68ec5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
- bugfix: ASCII colly diz with extended chars was causing an error
- deprecation: the "extras" subfolder of default script has been
moved to https://github.com/x84-extras
- bugfix: KeyError in hackernews.py
2.0.5
- bugfix: UnicodeDecodeError when quoting some messages
- bugfix: '__uploads__' folder not hidden by sftp as intended
Expand Down
8 changes: 7 additions & 1 deletion x84/default/hackernews.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,13 @@ def view_article_summaries(session, term, rss_url, rss_title):
echo(term.move(term.height // 2, 0))
echo(term.center('Fetching {0} ...'.format(term.bold(rss_url))).rstrip())
result = feedparser.parse(rss_url)
assert result['status'] == 200
if result.get('status') != 200:
# display 404, 500, or whatever non-200 code returned.
moveto_lastline = term.move(term.height, 0)
echo(moveto_lastline)
echo(term.center('failed: status={0}'.format(result.get('status'))))
term.inkey()
return

articles = [Article(title=post.title,
link=post.link,
Expand Down

0 comments on commit b68ec5f

Please sign in to comment.