Patchwork D2269: py3: use util.forcebytestr instead of str for converting errors to bytes

login
register
mail settings
Submitter phabricator
Date Feb. 15, 2018, 12:40 p.m.
Message ID <66912cb736482a2634b9840e54ea168e@localhost.localdomain>
Download mbox | patch
Permalink /patch/27966/
State Not Applicable
Headers show

Comments

phabricator - Feb. 15, 2018, 12:40 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG6ea0b78ddcac: py3: use util.forcebytestr instead of str for converting errors to bytes (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2269?vs=5725&id=5758

REVISION DETAIL
  https://phab.mercurial-scm.org/D2269

AFFECTED FILES
  hgext/transplant.py
  mercurial/patch.py

CHANGE DETAILS




To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel

Patch

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -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:
diff --git a/hgext/transplant.py b/hgext/transplant.py
--- a/hgext/transplant.py
+++ b/hgext/transplant.py
@@ -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: