From 0f384c791dd87564039fd23dd5a63a6025627717 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE <41120579+SimonSAMPERE@users.noreply.github.com> Date: Mon, 20 Jun 2022 16:18:23 +0200 Subject: [PATCH] #416 handle case when xdg-utils is not installed for log folder opening --- modules/tools.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/tools.py b/modules/tools.py index 280b04d6..aea8b2fd 100644 --- a/modules/tools.py +++ b/modules/tools.py @@ -190,9 +190,13 @@ def open_dir_file(self, target): proc = startfile(path.realpath(target)) elif opersys.startswith("linux"): # Linux: - proc = subprocess.Popen( - ["xdg-open", target], stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) + try: + proc = subprocess.Popen( + ["xdg-open", target], stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + except Exception as e: + logger.error("Unable to open log folder: {}".format(e)) + raise SystemError("Unable to open log folder, please try to install xdg-utils with the following command: sudo apt install xdg-utils") elif opersys == "darwin": # Mac: proc = subprocess.Popen(