f.write(html_template.format(categories=categories_html, summary=summary_html))
except IOError as e:
print('ERROR: writing HTML report failed ({})'.format(e.strerror))
f.write(html_template.format(categories=categories_html, summary=summary_html))
except IOError as e:
print('ERROR: writing HTML report failed ({})'.format(e.strerror))