diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py --- a/mercurial/mdiff.py +++ b/mercurial/mdiff.py @@ -17,6 +17,7 @@ from . import ( bdiff, error, mpatch, + pycompat, util, ) @@ -61,6 +62,7 @@ class diffopts(object): } def __init__(self, **opts): + opts = pycompat.byteskwargs(opts) for k in self.defaults.keys(): v = opts.get(k) if v is None: diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -2213,7 +2213,7 @@ def difffeatureopts(ui, opts=None, untru buildopts['nobinary'] = get('nobinary', forceplain=False) buildopts['noprefix'] = get('noprefix', forceplain=False) - return mdiff.diffopts(**buildopts) + return mdiff.diffopts(**pycompat.strkwargs(buildopts)) def diff(repo, node1=None, node2=None, match=None, changes=None, opts=None, losedatafn=None, prefix='', relroot='', copy=None):