Patchwork [06,of,10] py3: use pycompat.byteskwargs to converts kwargs to bytes

login
register
mail settings
Submitter Pulkit Goyal
Date May 4, 2017, 10:46 p.m.
Message ID <465fc9fb716a6c48ad9e.1493938011@pulkit-goyal>
Download mbox | patch
Permalink /patch/20445/
State Accepted
Headers show

Comments

Pulkit Goyal - May 4, 2017, 10:46 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1493840534 -19800
#      Thu May 04 01:12:14 2017 +0530
# Node ID 465fc9fb716a6c48ad9e39eb757443619b3f750d
# Parent  48c75bcbe8a3a4cc7e491c4c60707fa80faf9a9d
py3: use pycompat.byteskwargs to converts kwargs to bytes

baseformatter._item must contain both keys and values in bytes. So to make
sure that, we convert the opts back to bytes.

Patch

diff -r 48c75bcbe8a3 -r 465fc9fb716a mercurial/formatter.py
--- a/mercurial/formatter.py	Thu May 04 00:44:53 2017 +0530
+++ b/mercurial/formatter.py	Thu May 04 01:12:14 2017 +0530
@@ -114,6 +114,7 @@ 
 
 from . import (
     error,
+    pycompat,
     templatefilters,
     templatekw,
     templater,
@@ -178,6 +179,7 @@ 
         pass
     def data(self, **data):
         '''insert data into item that's not shown in default output'''
+        data = pycompat.byteskwargs(data)
         self._item.update(data)
     def write(self, fields, deftext, *fielddata, **opts):
         '''do default text output while assigning data to item'''