Patchwork D7467: util: convert an exception to bytes when passing to Abort()

login
register
mail settings
Submitter phabricator
Date Nov. 21, 2019, 11:23 p.m.
Message ID <differential-rev-PHID-DREV-bqrhfrtu4ix323jxf43h-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43397/
State Superseded
Headers show

Comments

phabricator - Nov. 21, 2019, 11:23 p.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I happened to notice this searching for how to convert an exception to bytes in
  the previous patch.  I'm pretty sure I've got a bunch of other instances that
  use `pycompat.bytestr()` suppressed locally.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1906,7 +1906,7 @@ 
                         ) & 0x7FFFFFFF
                         os.utime(dest, (advanced, advanced))
         except shutil.Error as inst:
-            raise error.Abort(str(inst))
+            raise error.Abort(stringutil.forcebytestr(inst))
 
 
 def copyfiles(src, dst, hardlink=None, progress=None):