From ef18cb4144c11c32dc9716a0d8318b377be88fff Mon Sep 17 00:00:00 2001 From: dbxnr Date: Thu, 9 Jan 2020 18:20:48 +0000 Subject: [PATCH 1/5] Fix for unhandled exception --- jrnl/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jrnl/util.py b/jrnl/util.py index 5918b14b..dfe0d13e 100644 --- a/jrnl/util.py +++ b/jrnl/util.py @@ -103,7 +103,7 @@ def set_keychain(journal_name, password): if password is None: try: keyring.delete_password("jrnl", journal_name) - except RuntimeError: + except keyring.errors.PasswordDeleteError: pass else: keyring.set_password("jrnl", journal_name, password) From 41c4c241cc9f3cb6a00094dd3dd234c602ca0142 Mon Sep 17 00:00:00 2001 From: Micah Ellison <4383304+micahellison@users.noreply.github.com> Date: Thu, 9 Jan 2020 20:34:38 -0800 Subject: [PATCH 2/5] #790 - closing temp file before passing it to editor to prevent file locking issues in Windows --- jrnl/util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jrnl/util.py b/jrnl/util.py index 5918b14b..7af8d6c4 100644 --- a/jrnl/util.py +++ b/jrnl/util.py @@ -142,21 +142,26 @@ def scope_config(config, journal_name): def get_text_from_editor(config, template=""): filehandle, tmpfile = tempfile.mkstemp(prefix="jrnl", text=True, suffix=".txt") + os.close(filehandle) + with open(tmpfile, "w", encoding="utf-8") as f: if template: f.write(template) + try: subprocess.call( shlex.split(config["editor"], posix="win" not in sys.platform) + [tmpfile] ) except AttributeError: subprocess.call(config["editor"] + [tmpfile]) + with open(tmpfile, "r", encoding="utf-8") as f: raw = f.read() - os.close(filehandle) os.remove(tmpfile) + if not raw: print("[Nothing saved to file]", file=sys.stderr) + return raw From 284db07a05b4c41557c65b88d56c7e820d68c349 Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Wed, 15 Jan 2020 06:16:04 +0000 Subject: [PATCH 3/5] Updating changelog [ci skip] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d5b4a5f..a3be2742 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ **Build:** +- Change PyPI auth method in build pipeline [\#807](https://github.com/jrnl-org/jrnl/pull/807) ([wren](https://github.com/wren)) - Automagically update the changelog you see before your very eyes! [\#806](https://github.com/jrnl-org/jrnl/pull/806) ([wren](https://github.com/wren)) - Update Black version and lock file to fix builds on develop branch [\#784](https://github.com/jrnl-org/jrnl/pull/784) ([wren](https://github.com/wren)) - Run black formatter on codebase for standardization [\#778](https://github.com/jrnl-org/jrnl/pull/778) ([wren](https://github.com/wren)) From b4be6fa161ff1b95309a74d06e376df355be341c Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Fri, 17 Jan 2020 03:03:35 +0000 Subject: [PATCH 4/5] Updating changelog [ci skip] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3be2742..d2f3a7a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ - Refactor password logic to prevent accidental password leakage [\#708](https://github.com/jrnl-org/jrnl/pull/708) ([pspeter](https://github.com/pspeter)) - Password confirmation [\#706](https://github.com/jrnl-org/jrnl/pull/706) ([pspeter](https://github.com/pspeter)) +**Fixed bugs:** + +- Close temp file before passing it to editor to prevent file locking issues in Windows [\#792](https://github.com/jrnl-org/jrnl/pull/792) ([micahellison](https://github.com/micahellison)) + **Build:** - Change PyPI auth method in build pipeline [\#807](https://github.com/jrnl-org/jrnl/pull/807) ([wren](https://github.com/wren)) From 306e048f19ded86a96c55283a075b3fa2bdbe66b Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Fri, 17 Jan 2020 03:21:23 +0000 Subject: [PATCH 5/5] Updating changelog [ci skip] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2f3a7a4..de50e8c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ **Fixed bugs:** - Close temp file before passing it to editor to prevent file locking issues in Windows [\#792](https://github.com/jrnl-org/jrnl/pull/792) ([micahellison](https://github.com/micahellison)) +- Fix crash while encrypting a journal on first run without saving password [\#789](https://github.com/jrnl-org/jrnl/pull/789) ([dbxnr](https://github.com/dbxnr)) **Build:**