From e073d9ad6670db97aff8a6954b344890469d303c Mon Sep 17 00:00:00 2001 From: holly sparkles Date: Sun, 24 Sep 2023 16:29:22 +0200 Subject: [PATCH] fix: fix crashing when subprocess output contains stderr --- src/livejrnl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/livejrnl.py b/src/livejrnl.py index 0ae28c1..b19eb59 100644 --- a/src/livejrnl.py +++ b/src/livejrnl.py @@ -28,8 +28,8 @@ def parse_args() -> dict: def get_journal() -> dict: """Load a jrnl journal and return it as JSON""" - json_data: str = subprocess.getoutput("jrnl --format json") - return json.loads(json_data) + json_data = subprocess.run(["jrnl", "--format", "json"], capture_output=True, encoding='UTF-8') + return json.loads(json_data.stdout) def get_default_config() -> dict: -- libgit2 1.7.2