Patchwork [3,of,9] py3: convert kwargs keys' back to bytes using pycompat.byteskwargs()

login
register
mail settings
Submitter Pulkit Goyal
Date June 23, 2017, 7:54 p.m.
Message ID <4fc224b346e387d4f79a.1498247697@workspace>
Download mbox | patch
Permalink /patch/21646/
State Accepted
Headers show

Comments

Pulkit Goyal - June 23, 2017, 7:54 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1498081224 -19800
#      Thu Jun 22 03:10:24 2017 +0530
# Node ID 4fc224b346e387d4f79ad368049bef13e5bde981
# Parent  2ed2c527b9ff174c7a67ee7051c2968ea1ce4f7d
py3: convert kwargs keys' back to bytes using pycompat.byteskwargs()

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1582,6 +1582,7 @@ 
 
     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 @@ 
         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: