util: convert an exception to bytes when passing to Abort() stable
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 21 Nov 2019 17:25:24 -0500
branchstable
changeset 43724 5be128f669d4
parent 43723 eab0b7383cd3
child 43734 88a306478556
util: convert an exception to bytes when passing to Abort() 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. Differential Revision: https://phab.mercurial-scm.org/D7467
mercurial/util.py
--- a/mercurial/util.py	Thu Nov 21 14:28:28 2019 -0500
+++ b/mercurial/util.py	Thu Nov 21 17:25:24 2019 -0500
@@ -1919,7 +1919,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):