diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -269,7 +269,7 @@ # ValueError is raised on Windows if the drive letters differ on # each path raise error.Abort(_('cannot calculate relative path'), - hint=str(e)) + hint=util.forcebytestr(e)) else: requirements += 'shared\n' diff --git a/mercurial/repair.py b/mercurial/repair.py --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -235,7 +235,7 @@ except OSError as e: if e.errno != errno.ENOENT: ui.warn(_('error removing %s: %s\n') % - (undovfs.join(undofile), str(e))) + (undovfs.join(undofile), util.forcebytestr(e))) except: # re-raises if backupfile: diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1996,7 +1996,8 @@ try: return _zlibdecompress(data) except zlib.error as e: - raise RevlogError(_('revlog decompress error: %s') % str(e)) + raise RevlogError(_('revlog decompress error: %s') % + util.forcebytestr(e)) # '\0' is more common than 'u' so it goes first. elif t == '\0': return data