From ae4ae8be700433c6e967b918ddc6af02eebc239a Mon Sep 17 00:00:00 2001 From: RJ <122295667+Liderate@users.noreply.github.com> Date: Thu, 3 Oct 2024 03:49:43 -0400 Subject: [PATCH] Use glob.escape for paths that contain square brackets (#161) Co-authored-by: RJ --- __init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 5725b5f..9d636b2 100644 --- a/__init__.py +++ b/__init__.py @@ -22,13 +22,14 @@ def createPlugins(): # We are going to list all game plugins: curpath = os.path.abspath(os.path.dirname(__file__)) + escaped_games_path = glob.escape(os.path.join(curpath, "games")) # List all the .ini files: - for file in glob.glob(os.path.join(curpath, "games", "*.ini")): + for file in glob.glob(os.path.join(escaped_games_path, "*.ini")): game_plugins.append(BasicIniGame(file)) # List all the python plugins: - for file in glob.glob(os.path.join(curpath, "games", "*.py")): + for file in glob.glob(os.path.join(escaped_games_path, "*.py")): module_p = os.path.relpath(file, os.path.join(curpath, "games")) if module_p == "__init__.py": continue