diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -1582,6 +1582,7 @@ def getbundlechunks(repo, source, heads= Returns an iterator over raw chunks (of varying sizes). """ + kwargs = pycompat.byteskwargs(kwargs) usebundle2 = bundle2requested(bundlecaps) # bundle10 case if not usebundle2: diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -1303,6 +1303,7 @@ class templater(object): return stringify(self('', **mapping)) def __call__(self, t, **mapping): + mapping = pycompat.byteskwargs(mapping) ttype = t in self.map and self.map[t][0] or 'default' if ttype not in self.ecache: try: