mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 08:38:32 +02:00
Use shlex to parse editor commandline as per 2.0-rc1 (#556)
This commit is contained in:
parent
240fb883cc
commit
6826f07b6e
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue