Use glob.escape for paths that contain square brackets (#161)

Co-authored-by: RJ <Liderate@users.noreply.github.com>
This commit is contained in:
RJ
2024-10-03 09:49:43 +02:00
committed by GitHub
co-authored by RJ
parent a581e28b0a
commit ae4ae8be70
+3 -2
View File
@@ -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