Mercurial > hg
diff mercurial/url.py @ 41590:349c8879becd
py3: ensure the HTTP password manager returns strings, not bytes
The digest handler calls into the password manager on its own, and it apparently
expects strings. Perhaps the Basic authentication handler didn't hit this
because of its manual password fetch and format in retry_http_basic_auth().
The `pycompat.bytesurl()` on the user and password just above the first url.py
diff seems unnecessary, because the password proxy in ui is converting to bytes
IIUC.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 05 Feb 2019 17:02:40 -0500 |
parents | d437d1e2a711 |
children | d20f1594ff4a |
line wrap: on
line diff
--- a/mercurial/url.py Tue Feb 05 16:47:19 2019 -0500 +++ b/mercurial/url.py Tue Feb 05 17:02:40 2019 -0500 @@ -65,7 +65,7 @@ user, passwd = pycompat.bytesurl(user), pycompat.bytesurl(passwd) if user and passwd: self._writedebug(user, passwd) - return (user, passwd) + return (pycompat.strurl(user), pycompat.strurl(passwd)) if not user or not passwd: res = httpconnectionmod.readauthforuri(self.ui, authuri, user) @@ -93,7 +93,7 @@ self.passwddb.add_password(realm, authuri, user, passwd) self._writedebug(user, passwd) - return (user, passwd) + return (pycompat.strurl(user), pycompat.strurl(passwd)) def _writedebug(self, user, passwd): msg = _('http auth: user %s, password %s\n')