Simple RSS Reader inspired by Gxxgle Reader
修订版 | ea2232ba2b1a8221604017c9a06f33f18d4058fb (tree) |
---|---|
时间 | 2015-06-17 17:10:06 |
作者 | hylom <hylom@hylo...> |
Commiter | hylom |
fix crash when invalid url inputed
@@ -19,7 +19,10 @@ def main(): | ||
19 | 19 | entries = fetcher.fetch(url) |
20 | 20 | for entry in entries: |
21 | 21 | entry.feed_id = fid |
22 | - print "insert {0}".format(entry.url) | |
22 | + try: | |
23 | + print "insert {0}".format(entry.url) | |
24 | + except UnicodeEncodeError: | |
25 | + print "insert {0}".format(entry.url.encode('utf-8')) | |
23 | 26 | db.append_feed_content(entry) |
24 | 27 | feeds = db.get_feeds(offset=read_count, limit=10) |
25 | 28 | read_count += 10 |