diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -53,6 +53,7 @@ def tokenize(program, start, end, term=N """Parse a template expression into a stream of tokens, which must end with term if specified""" pos = start + program = pycompat.bytestr(program) while pos < end: c = program[pos] if c.isspace(): # skip inter-token whitespace diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1913,6 +1913,7 @@ def strdate(string, format, defaults=Non # add missing elements from defaults usenow = False # default to using biased defaults for part in ("S", "M", "HI", "d", "mb", "yY"): # decreasing specificity + part = pycompat.bytestr(part) found = [True for p in part if ("%"+p) in format] if not found: date += "@" + defaults[part][usenow]