mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
fix script path escaping on windows, refs #293
This commit is contained in:
parent
c6911a4158
commit
c01b294d8d
@ -55,6 +55,9 @@ class Script:
|
||||
|
||||
@classmethod
|
||||
def parse_command(klass, command):
|
||||
if os.name == "nt": # Windows: escape all backslashes in the path.
|
||||
backslashes = shlex.split(command, posix=False)[0].count("\\")
|
||||
command = command.replace("\\", "\\\\", backslashes)
|
||||
args = shlex.split(command)
|
||||
args[0] = os.path.expanduser(args[0])
|
||||
if not os.path.exists(args[0]):
|
||||
|
Loading…
Reference in New Issue
Block a user