cast year ints to str, not bytes in bucket plugin

This seems to work equally well in py2/3
This commit is contained in:
Johnny Robeson 2016-06-15 03:34:03 -04:00
parent 7df59d5e30
commit a02a1f0201

View file

@ -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