diff --git a/PLUGINS.md b/PLUGINS.md index ef21e224..01a4632e 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -170,6 +170,8 @@ To package your plugin for distribution simply create a `.zip` archive of your p If there are any external dependencies then include them in the plugin's folder. +Optionally, for tidiness delete any `.pyc` and `.pyo` files in the archive. + # Disable a plugin EDMC now lets you disable a plugin without deleting it, simply rename the plugin folder to append ".disabled". Eg, diff --git a/plug.py b/plug.py index 4ad9e626..d4f6ada6 100644 --- a/plug.py +++ b/plug.py @@ -41,7 +41,8 @@ class Plugin(object): if loadfile: sys.stdout.write('loading plugin %s from "%s"\n' % (name, loadfile.encode('utf-8'))) with open(loadfile, 'rb') as plugfile: - module = imp.load_module('plugin_%s' % name, plugfile, '', ('.py', 'r', imp.PY_SOURCE)) + module = imp.load_module('plugin_%s' % name, plugfile, loadfile.encode(sys.getfilesystemencoding()), + ('.py', 'r', imp.PY_SOURCE)) newname = module.plugin_start() self.name = newname and unicode(newname) or name self.module = module