Commit 9e82daf8 authored by Denis Laxalde's avatar Denis Laxalde

py3: force bytestr conversion of "reason" in scmutil.callcatch()

For instance, reason may be an InvalidURL as shown in added test.

branch : stable
parent b06cf2809ec3
......@@ -262,7 +262,7 @@ def callcatch(ui, func):
if isinstance(reason, pycompat.unicode):
# SSLError of Python 2.7.9 contains a unicode
reason = encoding.unitolocal(reason)
ui.error(_(b"abort: error: %s\n") % reason)
ui.error(_(b"abort: error: %s\n") % stringutil.forcebytestr(reason))
elif (
util.safehasattr(inst, b"args")
and inst.args
......@@ -614,6 +614,12 @@ No local source
abort: repository a not found!
Invalid URL
$ hg clone http://invalid:url/a b
abort: error: nonnumeric port: 'url'
No remote source
#if windows
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment