From f65cf62c80bed7017f63836909d3252b2a46e300 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 30 Jun 2016 15:49:42 -0700 Subject: [PATCH] Use py3_path for plugin search paths (from #2096) --- beets/ui/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py index ba6d4b148..ba342f12c 100644 --- a/beets/ui/__init__.py +++ b/beets/ui/__init__.py @@ -1109,9 +1109,15 @@ def _load_plugins(config): paths = [util.normpath(p) for p in paths] log.debug(u'plugin paths: {0}', util.displayable_path(paths)) + # On Python 3, the search paths need to be unicode. + paths = [util.py3_path(p) for p in paths] + + # Extend the `beetsplug` package to include the plugin paths. import beetsplug beetsplug.__path__ = paths + beetsplug.__path__ - # For backwards compatibility. + + # For backwards compatibility, also support plugin paths that + # *contain* a `beetsplug` package. sys.path += paths plugins.load_plugins(config['plugins'].as_str_seq())