py3: use bytes() to byte-stringify url object in url.py
authorYuya Nishihara <yuya@tcha.org>
Sun, 18 Feb 2018 22:13:25 +0900
changeset 36341 548316560a05
parent 36340 37a1501cbcfd
child 36342 94a1ff16f362
py3: use bytes() to byte-stringify url object in url.py Perhaps we'll have to convert it back and forth from/to bytes and unicode at urllib boundary, but at least util.hidepassword() wants a byte string.
mercurial/url.py
--- a/mercurial/url.py	Sun Feb 18 22:12:11 2018 +0900
+++ b/mercurial/url.py	Sun Feb 18 22:13:25 2018 +0900
@@ -71,10 +71,10 @@
             u.query = None
             if not self.ui.interactive():
                 raise error.Abort(_('http authorization required for %s') %
-                                 util.hidepassword(str(u)))
+                                  util.hidepassword(bytes(u)))
 
             self.ui.write(_("http authorization required for %s\n") %
-                          util.hidepassword(str(u)))
+                          util.hidepassword(bytes(u)))
             self.ui.write(_("realm: %s\n") % realm)
             if user:
                 self.ui.write(_("user: %s\n") % user)
@@ -124,7 +124,7 @@
             else:
                 self.no_list = no_list
 
-            proxyurl = str(proxy)
+            proxyurl = bytes(proxy)
             proxies = {'http': proxyurl, 'https': proxyurl}
             ui.debug('proxying through %s\n' % util.hidepassword(proxyurl))
         else: