From 8ddf609815a3cddc25efe4b263c8496e7fdd4a81 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Fri, 24 Mar 2023 17:54:14 +0100 Subject: [PATCH] Use shlex for escaping quotes --- src/utils/bottles_parser.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/utils/bottles_parser.py b/src/utils/bottles_parser.py index 489a92a..a7a3827 100644 --- a/src/utils/bottles_parser.py +++ b/src/utils/bottles_parser.py @@ -18,6 +18,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later import os +import shlex import time import yaml @@ -113,14 +114,8 @@ def bottles_parser(parent_widget, action): continue values["name"] = game["name"] - values["executable"] = ( - "xdg-open " - + '"' - + "bottles:run/" - + game["bottle"]["name"] - + "/" - + game["name"] - + '"' + values["executable"] = "xdg-open " + shlex.quote( + "bottles:run/" + game["bottle"]["name"] + "/" + game["name"] ) values["hidden"] = False values["source"] = "bottles"