From f1cc40a87ca42923940ddb5c5e2e269cda404b84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 6 Jul 2020 18:31:30 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20PMGR:=20Fix=20single=20file=20pl?= =?UTF-8?q?ugins=20under=20Py2.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit filetype dependency requires paths as str, so we need to make sure we provide what will be identified as a native str type under both py2 and 3. Closes #3630 --- src/octoprint/plugins/pluginmanager/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py index b19dfd218..2707f9c83 100644 --- a/src/octoprint/plugins/pluginmanager/__init__.py +++ b/src/octoprint/plugins/pluginmanager/__init__.py @@ -14,7 +14,7 @@ from octoprint.settings import valid_boolean_trues from octoprint.server.util.flask import no_firstrun_access, with_revalidation_checking, check_etag from octoprint.access import ADMIN_GROUP from octoprint.access.permissions import Permissions -from octoprint.util import to_bytes, TemporaryDirectory +from octoprint.util import to_bytes, to_native_str, TemporaryDirectory from octoprint.util.pip import LocalPipCaller from octoprint.util.version import get_octoprint_version_string, get_octoprint_version, is_octoprint_compatible, is_python_compatible from octoprint.util.platform import get_os, is_os_compatible @@ -429,7 +429,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, if ext in PluginManagerPlugin.ARCHIVE_EXTENSIONS: return True - kind = filetype.guess(path) + kind = filetype.guess(to_native_str(path)) if kind: return ".{}".format(kind.extension) in PluginManagerPlugin.ARCHIVE_EXTENSIONS return False