From 346645d65589febd29de0b29289b777095d77189 Mon Sep 17 00:00:00 2001 From: Adam Waldenberg Date: Sat, 7 Nov 2015 05:49:24 +0100 Subject: [PATCH] The format.__output_html_template__(...) function now cleans up. --- gitinspector/format.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gitinspector/format.py b/gitinspector/format.py index ef751be..4b7740c 100644 --- a/gitinspector/format.py +++ b/gitinspector/format.py @@ -53,7 +53,11 @@ def is_interactive_format(): def __output_html_template__(name): template_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), name) file_r = open(template_path, "rb") - return file_r.read().decode("utf-8", "replace") + template = file_r.read().decode("utf-8", "replace") + + file_r.close() + return template + def __get_zip_file_content__(name, file_name="/html/flot.zip"): zip_file = zipfile.ZipFile(basedir.get_basedir() + file_name, "r") content = zip_file.read(name)