Browse Source

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
6.0.7
Seth Hillbrand 5 years ago
parent
commit
5354780904
  1. 7
      scripting/kicadplugins.i

7
scripting/kicadplugins.i

@ -192,8 +192,11 @@ def LoadPlugins(bundlepath=None, userpath=None):
bundlepath and userpath are strings utf-8 encoded (compatible "C" strings). bundlepath and userpath are strings utf-8 encoded (compatible "C" strings).
So convert these utf8 encoding to unicode strings to avoid any encoding issue. 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() config_path = pcbnew.SETTINGS_MANAGER.GetUserSettingsPath()
plugin_directories=[] plugin_directories=[]

Loading…
Cancel
Save