diff -r 24c0a9a7fa86 -r ce96efec8112 mercurial/util.py --- a/mercurial/util.py Sat Jun 24 13:20:30 2017 +0900 +++ b/mercurial/util.py Sat Jun 24 13:48:04 2017 +0900 @@ -2740,7 +2740,7 @@ attrs.append('%s: %r' % (a, v)) return '' % ', '.join(attrs) - def __str__(self): + def __bytes__(self): r"""Join the URL's components back into a URL string. Examples: @@ -2774,9 +2774,6 @@ >>> print url(r'file:///D:\data\hg') file:///D:\data\hg """ - return encoding.strfromlocal(self.__bytes__()) - - def __bytes__(self): if self._localpath: s = self.path if self.scheme == 'bundle': @@ -2820,6 +2817,8 @@ s += '#' + urlreq.quote(self.fragment, safe=self._safepchars) return s + __str__ = encoding.strmethod(__bytes__) + def authinfo(self): user, passwd = self.user, self.passwd try: