# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1497553372 -19800 # Node ID a05f3675c46a469a11c4bdf6016a714172188363 # Parent ed1f376090cd2a7719d5ec735fb669d7754b332e py3: add a new strurl() which will convert a bytes url to str diff -r ed1f376090cd -r a05f3675c46a mercurial/pycompat.py --- a/mercurial/pycompat.py Thu Jun 15 21:59:42 2017 -0400 +++ b/mercurial/pycompat.py Fri Jun 16 00:32:52 2017 +0530 @@ -173,6 +173,10 @@ return s return s.decode(u'latin-1') + def strurl(url): + """Converts a bytes url back to str""" + return url.decode(u'ascii') + def raisewithtb(exc, tb): """Raise exception with the given traceback""" raise exc.with_traceback(tb) @@ -244,6 +248,7 @@ iterbytestr = iter sysbytes = identity sysstr = identity + strurl = identity # this can't be parsed on Python 3 exec('def raisewithtb(exc, tb):\n'