From 51f9db16cf15ff549710df5aefc4ca068be60171 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Fri, 30 Jul 2010 09:45:33 -0700 Subject: [PATCH] _sorted_walk works only with unicode paths --- beets/autotag/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beets/autotag/__init__.py b/beets/autotag/__init__.py index ef236ea6f..2abcab18f 100644 --- a/beets/autotag/__init__.py +++ b/beets/autotag/__init__.py @@ -81,10 +81,13 @@ def _sorted_walk(path): """Like os.walk, but yields things in sorted, breadth-first order. """ + path = library._unicode_path(path) + # Get all the directories and files at this level. dirs = [] files = [] for base in os.listdir(path): + base = library._unicode_path(base) cur = os.path.join(path, base) if os.path.isdir(cur): dirs.append(base) @@ -108,7 +111,6 @@ def albums_in_dir(path): of lists of items where each list is probably an album. Specifically, any folder containing any media files is an album. """ - path = library._unicode_path(path) for root, dirs, files in _sorted_walk(path): # Get a list of items in the directory. items = []