From 55cea24b7b2a0773d429f1b3e68427bd643498e3 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 2 Jan 2014 09:46:01 -0800 Subject: [PATCH] don't attempt to string-format strings --- beets/library.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beets/library.py b/beets/library.py index 510b1ea0f..fe2892736 100644 --- a/beets/library.py +++ b/beets/library.py @@ -198,8 +198,9 @@ def format_for_path(value, key=None): with _, etc. Doesn't guarantee that the whole path will be valid; you should still call `util.sanitize_path` on the complete path. """ - if isinstance(value, str): - value = value.decode('utf8', 'ignore') + if isinstance(value, basestring): + if isinstance(value, str): + value = value.decode('utf8', 'ignore') elif key in ('track', 'tracktotal', 'disc', 'disctotal'): # Pad indices with zeros. value = u'%02i' % (value or 0)