From 50da2c8d0ea6aa1a0592cd93548a0d3bd090b45f Mon Sep 17 00:00:00 2001 From: Austin Scott <12504656+Austin-Scott@users.noreply.github.com> Date: Wed, 14 Nov 2018 12:20:12 -0600 Subject: [PATCH] Added @hollystyles' fix for Issue #415 (#564) Fixes the problem with permissions when trying to use an external editor to edit old entries on Windows. --- jrnl/util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/jrnl/util.py b/jrnl/util.py index e9df0fb1..ef8c7bea 100644 --- a/jrnl/util.py +++ b/jrnl/util.py @@ -127,6 +127,7 @@ def load_and_fix_json(json_path): def get_text_from_editor(config, template=""): _, tmpfile = tempfile.mkstemp(prefix="jrnl", text=True, suffix=".txt") + os.close(_) with codecs.open(tmpfile, 'w', "utf-8") as f: if template: f.write(template)