From 245f54943e5a717770c905940881fbaa575da517 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 11 Oct 2024 21:10:38 +0200 Subject: [PATCH] Core: make shlex split an attempt with regular split retry --- MultiServer.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MultiServer.py b/MultiServer.py index 0fe950b5e4f3..8dfad5040de3 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -1153,7 +1153,10 @@ def __call__(self, raw: str) -> typing.Optional[bool]: if not raw: return try: - command = shlex.split(raw, comments=False) + try: + command = shlex.split(raw, comments=False) + except ValueError: # most likely: "ValueError: No closing quotation" + command = raw.split() basecommand = command[0] if basecommand[0] == self.marker: method = self.commands.get(basecommand[1:].lower(), None)