From cf80244375851dff01aaab467f7f24f555d6d778 Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Thu, 24 Jun 2021 23:19:56 +0300 Subject: [PATCH] plugins: Don't treat keys of api as bytes The plugin `plugins` iterates over the keys of API instance, __iter__ of which is a generator of class.__name__ from (Command, Object, Method, Backend, Updater). So, the allowed type is str, not bytes. Fixes: https://pagure.io/freeipa/issue/8898 Signed-off-by: Stanislav Levin Reviewed-By: Rob Crittenden --- ipalib/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipalib/misc.py b/ipalib/misc.py index a5f9b6daa..264ec298f 100644 --- a/ipalib/misc.py +++ b/ipalib/misc.py @@ -124,7 +124,7 @@ class plugins(LocalOrRemote): for plugin in self.api[namespace](): cls = type(plugin) key = '{}.{}'.format(cls.__module__, cls.__name__) - result.setdefault(key, []).append(namespace.decode('utf-8')) + result.setdefault(key, []).append(namespace) return dict( result=result,