[issue3040] crash when cloning via https using keyring, subrepos

Jeff Schenck bugs at mercurial.selenic.com
Fri Oct 7 19:59:31 CDT 2011


New submission from Jeff Schenck <jeff.schenck at dts.com>:

After upgrading to 1.9.3 and trying to clone like this

hg clone https://server.dts.com/hg/prod/foo

mercurial crashes with the (abridged) output:

  File "/usr/local/lib/python2.7/site-packages/hgext/mercurial_keyring.py",
line 242, in load_hgrc_auth
    res = readauthforuri(local_ui, base_url)
TypeError: readauthforuri() takes exactly 3 arguments (2 given)

I was able to get around this problem by changing the call in
mercurial_keyring.py to "readauthforuri(local_ui, base_url, None).  But then
I encountered a different problem that I had first observed in version
1.9.1, using subrepos.  For every subrepo being cloned, I am prompted for my
password (which sort of defeats the purpose of the keyring).  So I am
sticking with 1.8.3 for now, which doesn't have that issue.

Thanks for your help,
Jeff

OS: Linux
Python 2.7.1
Mercurial 1.9.3

.hgrc file:
[ui]
username = Jeff Schenck <jeff.schenck at dts.com>
merge = emacs
ignore = ~/.hgstuff/ignore

[auth]
bms-scm01.prefix = server.dts.com/hg
bms-scm01.username = jschenck
bms-scm01.schemes = https

[merge-tools]
emacs.executable = emacs
emacs.args = -q --eval "(ediff-merge-with-ancestor \"$local\" \"$other\"
\"$base\" nil \"$output\")"

[extensions]
mercurial_keyring =
graphlog =
hgk =
color =
purge =
convert =

[web]
cacerts = /etc/pki/tls/certs/ca-bundle.crt


full error output:
** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.7.1 (r271:86832, May 24 2011, 17:18:42) [GCC 4.1.2 20080704 (Red
Hat 4.1.2-50)]
** Mercurial Distributed SCM (version 1.9.3)
** Extensions loaded: mercurial_keyring, graphlog, hgk, color, purge, convert
Traceback (most recent call last):
  File "/usr/local/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
27, in run
    sys.exit(dispatch(request(sys.argv[1:])))
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
64, in dispatch
    return _runcatch(req)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
87, in _runcatch
    return _dispatch(req)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
688, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
463, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/local/lib/python2.7/site-packages/mercurial/extensions.py",
line 182, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/hgext/color.py", line 368, in
colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
742, in _runcommand
    return checkargs()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
696, in checkargs
    return cmdfunc()
  File "/usr/local/lib/python2.7/site-packages/mercurial/dispatch.py", line
685, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/local/lib/python2.7/site-packages/mercurial/util.py", line 389,
in check
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mercurial/commands.py", line
1041, in clone
    branch=opts.get('branch'))
  File "/usr/local/lib/python2.7/site-packages/mercurial/hg.py", line 217,
in clone
    srcrepo = repository(remoteui(ui, peeropts), source)
  File "/usr/local/lib/python2.7/site-packages/mercurial/hg.py", line 93, in
repository
    repo = _peerlookup(path).instance(ui, path, create)
  File "/usr/local/lib/python2.7/site-packages/mercurial/httprepo.py", line
233, in instance
    inst._fetchcaps()
  File "/usr/local/lib/python2.7/site-packages/mercurial/httprepo.py", line
56, in _fetchcaps
    self.caps = set(self._call('capabilities').split())
  File "/usr/local/lib/python2.7/site-packages/mercurial/httprepo.py", line
166, in _call
    fp = self._callstream(cmd, **args)
  File "/usr/local/lib/python2.7/site-packages/mercurial/httprepo.py", line
116, in _callstream
    resp = self.urlopener.open(req)
  File "/usr/local/lib/python2.7/urllib2.py", line 398, in open
    response = meth(req, response)
  File "/usr/local/lib/python2.7/urllib2.py", line 511, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/lib/python2.7/urllib2.py", line 430, in error
    result = self._call_chain(*args)
  File "/usr/local/lib/python2.7/urllib2.py", line 370, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python2.7/urllib2.py", line 871, in http_error_401
    url, req, headers)
  File "/usr/local/lib/python2.7/site-packages/mercurial/url.py", line 429,
in http_error_auth_reqed
    self, auth_header, host, req, headers)
  File "/usr/local/lib/python2.7/urllib2.py", line 846, in http_error_auth_reqed
    response = self.retry_http_basic_auth(host, req, realm)
  File "/usr/local/lib/python2.7/urllib2.py", line 852, in retry_http_basic_auth
    user, pw = self.passwd.find_user_password(realm, host)
  File "/usr/local/lib/python2.7/site-packages/hgext/mercurial_keyring.py",
line 298, in find_user_password
    return self._pwd_handler.find_auth(self, realm, authuri)
  File "/usr/local/lib/python2.7/site-packages/hgext/mercurial_keyring.py",
line 123, in find_auth
    auth_user, pwd, prefix_url = self.load_hgrc_auth(ui, base_url)
  File "/usr/local/lib/python2.7/site-packages/hgext/mercurial_keyring.py",
line 242, in load_hgrc_auth
    res = readauthforuri(local_ui, base_url)
TypeError: readauthforuri() takes exactly 3 arguments (2 given)

----------
messages: 17594
nosy: jschenck
priority: bug
status: unread
title: crash when cloning via https using keyring, subrepos

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3040>
____________________________________________________


More information about the Mercurial-devel mailing list