mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-11 00:58:31 +02:00
Safer temp file creation
This commit is contained in:
parent
9603f7d3ad
commit
94b53b9247
1 changed files with 1 additions and 1 deletions
|
@ -116,7 +116,7 @@ def load_and_fix_json(json_path):
|
|||
sys.exit(1)
|
||||
|
||||
def get_text_from_editor(config, template=""):
|
||||
tmpfile = os.path.join(tempfile.mktemp(prefix="jrnl"))
|
||||
_, tmpfile = os.path.join(tempfile.mkstemp(prefix="jrnl", text=True, suffix=".txt"))
|
||||
with codecs.open(tmpfile, 'w', "utf-8") as f:
|
||||
if template:
|
||||
f.write(template)
|
||||
|
|
Loading…
Add table
Reference in a new issue