# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1518610413 -19800 # Node ID 6ea0b78ddcacc0354fbb08b31ffba78bef218ff2 # Parent ddeb7653b31cba763f08468d961f7afc73ff37ec py3: use util.forcebytestr instead of str for converting errors to bytes Differential Revision: https://phab.mercurial-scm.org/D2269 diff -r ddeb7653b31c -r 6ea0b78ddcac hgext/transplant.py --- a/hgext/transplant.py Wed Feb 14 16:37:46 2018 +0530 +++ b/hgext/transplant.py Wed Feb 14 17:43:33 2018 +0530 @@ -311,7 +311,7 @@ p1 = repo.dirstate.p1() p2 = node self.log(user, date, message, p1, p2, merge=merge) - self.ui.write(str(inst) + '\n') + self.ui.write(util.forcebytestr(inst) + '\n') raise TransplantError(_('fix up the working directory and run ' 'hg transplant --continue')) else: diff -r ddeb7653b31c -r 6ea0b78ddcac mercurial/patch.py --- a/mercurial/patch.py Wed Feb 14 16:37:46 2018 +0530 +++ b/mercurial/patch.py Wed Feb 14 17:43:33 2018 +0530 @@ -1459,7 +1459,7 @@ dec.append(util.b85decode(line[1:])[:l]) except ValueError as e: raise PatchError(_('could not decode "%s" binary patch: %s') - % (self._fname, str(e))) + % (self._fname, util.forcebytestr(e))) line = getline(lr, self.hunk) text = zlib.decompress(''.join(dec)) if len(text) != size: