# HG changeset patch # User Matt Harbison # Date 2019-11-21 22:25:24 # Node ID 5be128f669d40fd5921a34ce176f42dfae613e6b # Parent eab0b7383cd3ba388cdbd9dd8a617f0c288e8731 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 diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1919,7 +1919,7 @@ def copyfile(src, dest, hardlink=False, ) & 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):