From d6d2f55a4f4f36519192706501880f11aa0b7217 Mon Sep 17 00:00:00 2001 From: Miroslav Date: Mon, 19 Feb 2018 23:50:46 +0200 Subject: shlex.quote --- mitmproxy/tools/console/consoleaddons.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mitmproxy/tools/console/consoleaddons.py b/mitmproxy/tools/console/consoleaddons.py index e8979b01..c73eda42 100644 --- a/mitmproxy/tools/console/consoleaddons.py +++ b/mitmproxy/tools/console/consoleaddons.py @@ -1,4 +1,5 @@ import csv +import shlex import typing from mitmproxy import ctx @@ -259,7 +260,7 @@ class ConsoleAddon: def callback(opt): # We're now outside of the call context... - repl = "\"" + " ".join(args) + "\"" + repl = shlex.quote(" ".join(args)) repl = repl.replace("{choice}", opt) try: self.master.commands.call(subcmd + " " + repl) -- cgit v1.2.3