From 5fd67603e543727e9e5568ee9638683ffb4ca472 Mon Sep 17 00:00:00 2001 From: libertysoft3 Date: Sat, 18 Jul 2020 12:02:09 -0700 Subject: [PATCH] resolve missing key error in write_html load_links, issue #23 --- write_html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/write_html.py b/write_html.py index 4a4cf61..05a6f58 100755 --- a/write_html.py +++ b/write_html.py @@ -620,7 +620,7 @@ def load_links(date, subreddit, with_comments=False): with open(daily_links_path, 'r', encoding='utf-8') as links_file: reader = csv.DictReader(links_file) for link_row in reader: - if with_comments: + if with_comments and 'id' in link_row.keys(): comments = [] comments_file_path = daily_path + '/' + link_row['id'] + '.csv' if os.path.isfile(comments_file_path):