From 8f9981a3b65aaa0e3f72af41a77c960628777a74 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 27 Jul 2022 21:59:23 +1000 Subject: [PATCH] Convert PosixPath to string for plugin loading (#3423) --- InvenTree/plugin/registry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InvenTree/plugin/registry.py b/InvenTree/plugin/registry.py index 1ef37ddee2..0d3ceef480 100644 --- a/InvenTree/plugin/registry.py +++ b/InvenTree/plugin/registry.py @@ -252,7 +252,8 @@ class PluginsRegistry: # If a "path" is provided, some special handling is required if parent_obj.name is not plugin and len(parent_obj.parts) > 1: - parent_path = parent_obj.parent + # Ensure PosixPath object is converted to a string, before passing to get_plugins + parent_path = str(parent_obj.parent) plugin = parent_obj.name modules = get_plugins(importlib.import_module(plugin), InvenTreePlugin, path=parent_path)