From 535478090401c5aecd13deed183b18c898357bae Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 21 Feb 2021 11:22:43 -0800 Subject: [PATCH] Fix Linux/Python3 issue with plugins Strings are not always encoded, so we get exceptions when trying to double-decode. Just keep strings as-in in this case --- scripting/kicadplugins.i | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripting/kicadplugins.i b/scripting/kicadplugins.i index 1f7eeb6dc7..f9b8b02125 100644 --- a/scripting/kicadplugins.i +++ b/scripting/kicadplugins.i @@ -192,8 +192,11 @@ def LoadPlugins(bundlepath=None, userpath=None): bundlepath and userpath are strings utf-8 encoded (compatible "C" strings). So convert these utf8 encoding to unicode strings to avoid any encoding issue. """ - bundlepath = bundlepath.decode( 'UTF-8' ); - userpath = userpath.decode( 'UTF-8' ); + try: + bundlepath = bundlepath.decode( 'UTF-8' ); + userpath = userpath.decode( 'UTF-8' ); + except AttributeError: + pass config_path = pcbnew.SETTINGS_MANAGER.GetUserSettingsPath() plugin_directories=[]