Submitter | phabricator |
---|---|
Date | March 3, 2018, 6:58 p.m. |
Message ID | <b7ecbbae7fba4aab5cf602d7d9673dd3@localhost.localdomain> |
Download | mbox | patch |
Permalink | /patch/28796/ |
State | Not Applicable |
Headers | show |
Comments
Patch
diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py --- a/mercurial/pycompat.py +++ b/mercurial/pycompat.py @@ -192,11 +192,15 @@ def strurl(url): """Converts a bytes url back to str""" - return url.decode(u'ascii') + if isinstance(url, bytes): + return url.decode(u'ascii') + return url def bytesurl(url): """Converts a str url to bytes by encoding in ascii""" - return url.encode(u'ascii') + if isinstance(url, str): + return url.encode(u'ascii') + return url def raisewithtb(exc, tb): """Raise exception with the given traceback"""