From 6826f07b6e03988e6224745ffcb7ed730c60dd74 Mon Sep 17 00:00:00 2001 From: hoclun-rigsep Date: Thu, 16 Aug 2018 18:16:29 -0400 Subject: [PATCH] Use shlex to parse editor commandline as per 2.0-rc1 (#556) --- jrnl/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jrnl/util.py b/jrnl/util.py index f6a7735f7..2cf540577 100644 --- a/jrnl/util.py +++ b/jrnl/util.py @@ -163,7 +163,10 @@ def get_text_from_editor(config, template=""): with codecs.open(tmpfile, 'w', "utf-8") as f: if template: f.write(template) - subprocess.call(shlex.split(config['editor'], posix="win" not in sys.platform) + [tmpfile]) + try: + subprocess.call(shlex.split(config['editor'], posix="win" not in sys.platform) + [tmpfile]) + except AttributeError: + subprocess.call(config['editor'] + [tmpfile]) with codecs.open(tmpfile, "r", "utf-8") as f: raw = f.read() os.close(filehandle)