Skip to content

Commit

Permalink
Use shlex to parse editor commandline as per 2.0-rc1 (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoclun-rigsep committed Aug 16, 2018
1 parent 240fb88 commit 6826f07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jrnl/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6826f07

Please sign in to comment.