mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-29 22:16:13 +02:00
Fix for #322
This commit is contained in:
parent
ca76077e09
commit
07fbf73dee
4 changed files with 13 additions and 22 deletions
|
@ -12,6 +12,8 @@ import tempfile
|
|||
import subprocess
|
||||
import codecs
|
||||
import unicodedata
|
||||
import shlex
|
||||
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
PY2 = sys.version_info[0] == 2
|
||||
|
@ -121,9 +123,7 @@ def get_text_from_editor(config, template=""):
|
|||
with codecs.open(tmpfile, 'w', "utf-8") as f:
|
||||
if template:
|
||||
f.write(template)
|
||||
editor = config['editor']
|
||||
args = editor if isinstance(editor, list) else editor.split()
|
||||
subprocess.call(args + [tmpfile])
|
||||
subprocess.call(shlex.split(config['editor']) + [tmpfile])
|
||||
with codecs.open(tmpfile, "r", "utf-8") as f:
|
||||
raw = f.read()
|
||||
os.close(filehandle)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue