From eb641b3e358fdbf21ea3d93f630571253286408c Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Sun, 13 Oct 2019 18:18:26 -0400 Subject: [PATCH 1/2] Fix a leaking file descriptor. --- archivebox/index.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/archivebox/index.py b/archivebox/index.py index 3f4ada3f..802a7f0b 100644 --- a/archivebox/index.py +++ b/archivebox/index.py @@ -186,7 +186,8 @@ def patch_links_index(link, out_dir=OUTPUT_DIR): # Patch HTML index html_path = os.path.join(out_dir, 'index.html') - html = open(html_path, 'r').read().split('\n') + with open(html_path, 'r') as html_file: + html = [line[:-1] for line in html_file] for idx, line in enumerate(html): if title and (' Date: Sat, 19 Oct 2019 12:47:42 -0400 Subject: [PATCH 2/2] Update archivebox/index.py Co-Authored-By: Nick Sweeting --- archivebox/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivebox/index.py b/archivebox/index.py index 802a7f0b..0fdf9b62 100644 --- a/archivebox/index.py +++ b/archivebox/index.py @@ -187,7 +187,7 @@ def patch_links_index(link, out_dir=OUTPUT_DIR): # Patch HTML index html_path = os.path.join(out_dir, 'index.html') with open(html_path, 'r') as html_file: - html = [line[:-1] for line in html_file] + html = html_file.read().splitlines() for idx, line in enumerate(html): if title and ('