From e72aab34488337ed9e4486269a08d5b88e392e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 3 Sep 2020 17:24:27 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20plugin=20installation=20un?= =?UTF-8?q?der=20Windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the temporary file contained characters blacklisted by sarge.shell_quote, e.g. a ~, the shell quote would break the install path on windows. Considering that the path will now always be a temporary path as generated by Tempfile, we just get rid of shell_quote altogether as it doesn't seem to really serve any purpose now anymore. Closes #3701 --- src/octoprint/plugins/pluginmanager/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py index 73ba7257f..f49222fa8 100644 --- a/src/octoprint/plugins/pluginmanager/__init__.py +++ b/src/octoprint/plugins/pluginmanager/__init__.py @@ -502,13 +502,13 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, path_url = "file://" + path if os.sep != "/": # windows gets special handling - path = path.replace(os.sep, "/").lower() - path_url = "file:///" + path + path_url = "file:///" + path.replace(os.sep, "/").lower() already_installed_check = lambda line: path_url in line.lower() # lower case in case of windows + # as we now always install from a local temporary file, shell quoting should no longer be necessary self._logger.info("Installing plugin from {}".format(source)) - pip_args = ["--disable-pip-version-check", "install", sarge.shell_quote(path_url), "--no-cache-dir"] + pip_args = ["--disable-pip-version-check", "install", path, "--no-cache-dir"] if dependency_links or self._settings.get_boolean(["dependency_links"]): pip_args.append("--process-dependency-links")