From 01a7f660f3ab6eb087b033b3939fbcd03e322911 Mon Sep 17 00:00:00 2001 From: Craig Moyer Date: Tue, 9 Dec 2014 20:54:58 -0500 Subject: [PATCH] Close temp file before deleting it. --- jrnl/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jrnl/util.py b/jrnl/util.py index 5f0571cf..d60345be 100644 --- a/jrnl/util.py +++ b/jrnl/util.py @@ -125,9 +125,10 @@ def get_text_from_editor(config, template=""): with codecs.open(tmpfile, 'w', "utf-8") as f: if template: f.write(template) - subprocess.call(config['editor'].split() + [tmpfile]) + subprocess.call(config['editor'].split() + [tmpfile]) with codecs.open(tmpfile, "r", "utf-8") as f: raw = f.read() + os.close(_); os.remove(tmpfile) if not raw: prompt('[Nothing saved to file]')