From a02a1f0201ddf5b644d74f9498ff1dce54c0a1af Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Wed, 15 Jun 2016 03:34:03 -0400 Subject: [PATCH] cast year ints to str, not bytes in bucket plugin This seems to work equally well in py2/3 --- beetsplug/bucket.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beetsplug/bucket.py b/beetsplug/bucket.py index 21acb1f1e..7ce0d0d43 100644 --- a/beetsplug/bucket.py +++ b/beetsplug/bucket.py @@ -137,9 +137,10 @@ def str2fmt(s): def format_span(fmt, yearfrom, yearto, fromnchars, tonchars): """Return a span string representation. """ - args = (bytes(yearfrom)[-fromnchars:]) + args = (str(yearfrom)[-fromnchars:]) if tonchars: - args = (bytes(yearfrom)[-fromnchars:], bytes(yearto)[-tonchars:]) + args = (str(yearfrom)[-fromnchars:], str(yearto)[-tonchars:]) + return fmt % args