mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-11 15:07:09 +00:00
Fix a leaking file descriptor.
This commit is contained in:
parent
73cdb8dafe
commit
eb641b3e35
1 changed files with 2 additions and 1 deletions
|
@ -186,7 +186,8 @@ def patch_links_index(link, out_dir=OUTPUT_DIR):
|
||||||
|
|
||||||
# Patch HTML index
|
# Patch HTML index
|
||||||
html_path = os.path.join(out_dir, 'index.html')
|
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):
|
for idx, line in enumerate(html):
|
||||||
if title and ('<span data-title-for="{}"'.format(link['url']) in line):
|
if title and ('<span data-title-for="{}"'.format(link['url']) in line):
|
||||||
html[idx] = '<span>{}</span>'.format(title)
|
html[idx] = '<span>{}</span>'.format(title)
|
||||||
|
|
Loading…
Reference in a new issue