[issue570] Stacktrace when pushing across HTTP "Basic" Auth and using wrong username/password

Sam Hart mercurial-bugs at selenic.com
Thu May 24 17:03:07 UTC 2007


New submission from Sam Hart <sam at samhart.net>:

When you have a remote repo using hgweb.cgi or hgwebdir.cgi over HTTP using
Apache with "AuthType Basic" set, if you try to push with an incorrect
username/password combination you get the following stacktrace from hg:

$ hg push
pushing to http://someurl/somerepo/
searching for changes
http authorization required
realm: Dev Repo
user: sam
password: 
** unknown exception encountered, details follow
** report bug details to http://www.selenic.com/mercurial/bts
** or mercurial at selenic.com
** Mercurial Distributed SCM (version 0.9.3)
Traceback (most recent call last):
  File "/usr/bin/hg", line 12, in ?
    commands.run()
  File "/var/lib/python-support/python2.4/mercurial/commands.py", line 3000, in run
    sys.exit(dispatch(sys.argv[1:]))
  File "/var/lib/python-support/python2.4/mercurial/commands.py", line 3223, in
dispatch
    return d()
  File "/var/lib/python-support/python2.4/mercurial/commands.py", line 3182, in
<lambda>
    d = lambda: func(u, repo, *args, **cmdoptions)
  File "/var/lib/python-support/python2.4/mercurial/commands.py", line 1971, in push
    r = repo.push(other, opts['force'], revs=revs)
  File "/var/lib/python-support/python2.4/hgext/mq.py", line 2025, in push
    return super(mqrepo, self).push(remote, force, revs)
  File "/var/lib/python-support/python2.4/mercurial/localrepo.py", line 1360, in
push
    return self.push_unbundle(remote, force, revs)
  File "/var/lib/python-support/python2.4/mercurial/localrepo.py", line 1438, in
push_unbundle
    return remote.unbundle(cg, remote_heads, 'push')
  File "/var/lib/python-support/python2.4/mercurial/httprepo.py", line 352, in
unbundle
    heads=' '.join(map(hex, heads)))
  File "/var/lib/python-support/python2.4/mercurial/httprepo.py", line 235, in
do_cmd
    resp = urllib2.urlopen(urllib2.Request(cu, data, headers))
  File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.4/urllib2.py", line 364, in open
    response = meth(req, response)
  File "/usr/lib/python2.4/urllib2.py", line 471, in http_response
    response = self.parent.error(
  File "/usr/lib/python2.4/urllib2.py", line 396, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.4/urllib2.py", line 741, in http_error_401
    host, req, headers)
  File "/usr/lib/python2.4/urllib2.py", line 720, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
  File "/usr/lib/python2.4/urllib2.py", line 730, in retry_http_basic_auth
    return self.parent.open(req)
  File "/usr/lib/python2.4/urllib2.py", line 364, in open
    response = meth(req, response)
  File "/usr/lib/python2.4/urllib2.py", line 471, in http_response
    response = self.parent.error(
  File "/usr/lib/python2.4/urllib2.py", line 396, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.4/urllib2.py", line 916, in http_error_401
    host, req, headers)
  File "/usr/lib/python2.4/urllib2.py", line 807, in http_error_auth_reqed
    raise ValueError("AbstractDigestAuthHandler doesn't know "
ValueError: AbstractDigestAuthHandler doesn't know about Basic

----------
messages: 3124
nosy: criswell
priority: bug
status: unread
title: Stacktrace when pushing across HTTP "Basic" Auth and using wrong username/password

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




More information about the Mercurial-devel mailing list