Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 15028:eb97a3e38656
http: explain why the host is passed to urllib2 password manager
The original comment was in url.getauthinfo() and was lost in bf6156bab41b.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 06 Aug 2011 14:10:59 +0200 |
parents | 1e45b92f4fb2 |
children | 0cb27eda3a1e |
comparison
equal
deleted
inserted
replaced
15027:1e45b92f4fb2 | 15028:eb97a3e38656 |
---|---|
1587 s = str(self) | 1587 s = str(self) |
1588 finally: | 1588 finally: |
1589 self.user, self.passwd = user, passwd | 1589 self.user, self.passwd = user, passwd |
1590 if not self.user: | 1590 if not self.user: |
1591 return (s, None) | 1591 return (s, None) |
1592 # authinfo[1] is passed to urllib2 password manager, and its URIs | 1592 # authinfo[1] is passed to urllib2 password manager, and its |
1593 # must not contain credentials. | 1593 # URIs must not contain credentials. The host is passed in the |
1594 # URIs list because Python < 2.4.3 uses only that to search for | |
1595 # a password. | |
1594 return (s, (None, (s, self.host), | 1596 return (s, (None, (s, self.host), |
1595 self.user, self.passwd or '')) | 1597 self.user, self.passwd or '')) |
1596 | 1598 |
1597 def isabs(self): | 1599 def isabs(self): |
1598 if self.scheme and self.scheme != 'file': | 1600 if self.scheme and self.scheme != 'file': |