Skip to content

Commit b123e57

Browse files
committed
fix: handle case where server path has spaces
1 parent 3dcd2cd commit b123e57

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rlbot/utils/gateway.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from rlbot.utils.logging import DEFAULT_LOGGER
1212
from rlbot.utils.os_detector import CURRENT_OS
1313

14+
if CURRENT_OS != "Windows":
15+
import shlex
1416

1517
def find_main_executable_path(
1618
main_executable_path: Path, main_executable_name: str
@@ -77,7 +79,7 @@ def launch(
7779
if CURRENT_OS == "Windows":
7880
args = [str(path), str(port)]
7981
else:
80-
args = f"{path} {port}" # on Unix, when shell=True, args must be a string for flags to reach the executable
82+
args = f"{shlex.quote(path.as_posix())} {port}" # on Unix, when shell=True, args must be a string for flags to reach the executable
8183
DEFAULT_LOGGER.info("Launching RLBotServer with via %s", args)
8284

8385
return subprocess.Popen(args, shell=True, cwd=directory), port

0 commit comments

Comments
 (0)