diff -r 9a94239e4f12 -r 067add650129 mercurial/extensions.py --- a/mercurial/extensions.py Mon Mar 13 08:53:31 2017 -0700 +++ b/mercurial/extensions.py Mon Mar 13 09:11:08 2017 -0700 @@ -109,7 +109,7 @@ """Portably format an import error into a form suitable for %-formatting into bytestrings.""" if pycompat.ispy3: - return encoding.tolocal(str(inst).encode('utf-8')) + return encoding.unitolocal(str(inst)) return inst def _reportimporterror(ui, err, failed, next):