[Bug 6629] New: Special char in password not supported

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Thu Jan 6 10:02:21 UTC 2022


https://bz.mercurial-scm.org/show_bug.cgi?id=6629

            Bug ID: 6629
           Summary: Special char in password not supported
           Product: Mercurial
           Version: 6.0.1
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: aklitzing at gmail.com
                CC: mercurial-devel at mercurial-scm.org
    Python Version: ---

If we use a special char in a password for http authentication we get the
following error.

** Unknown exception encountered with possibly-broken third-party extension
"commitsigs" (version N/A)
** which supports versions unknown of Mercurial.
** Please disable "commitsigs" and try your action again.
** If that fixes the bug please report it to Der Autor der Erweiterung
** Python 3.10.1 (main, Dec 18 2021, 23:53:45) [GCC 11.1.0]
** Mercurial Distributed SCM (Version 6.0)
** Erweiterungen geladen: absorb, churn, commitsigs, convert, extdiff, gpg,
histedit, largefiles, patchbomb, purge, rebase, record, releasenotes, schemes,
share, show, strip
Traceback (most recent call last):
  File "/usr/bin/hg", line 61, in <module>
    dispatch.run()
  File "/usr/lib/python3.10/site-packages/mercurial/dispatch.py", line 144, in
run
    status = dispatch(req)
  File "/usr/lib/python3.10/site-packages/mercurial/dispatch.py", line 250, in
dispatch
    status = _rundispatch(req)
  File "/usr/lib/python3.10/site-packages/mercurial/dispatch.py", line 294, in
_rundispatch
    ret = _runcatch(req) or 0
  File "/usr/lib/python3.10/site-packages/mercurial/dispatch.py", line 470, in
_runcatch
    return _callcatch(ui, _runcatchfunc)
  File "/usr/lib/python3.10/site-packages/mercurial/dispatch.py", line 480, in
_callcatch
    return scmutil.callcatch(ui, func)
  File "/usr/lib/python3.10/site-packages/mercurial/scmutil.py", line 153, in
callcatch
    return func()
  File "/usr/lib/python3.10/site-packages/mercurial/dispatch.py", line 460, in
_runcatchfunc
    return _dispatch(req)
  File "/usr/lib/python3.10/site-packages/mercurial/dispatch.py", line 1273, in
_dispatch
    return runcommand(
  File "/usr/lib/python3.10/site-packages/mercurial/dispatch.py", line 918, in
runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python3.10/site-packages/mercurial/dispatch.py", line 1285, in
_runcommand
    return cmdfunc()
  File "/usr/lib/python3.10/site-packages/mercurial/dispatch.py", line 1271, in
<lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/usr/lib/python3.10/site-packages/mercurial/util.py", line 1888, in
check
    return func(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/mercurial/util.py", line 1888, in
check
    return func(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/hgext/share.py", line 163, in clone
    return orig(ui, source, *args, **opts)
  File "/usr/lib/python3.10/site-packages/mercurial/util.py", line 1888, in
check
    return func(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/mercurial/util.py", line 1888, in
check
    return func(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/hgext/largefiles/overrides.py", line
1091, in overrideclone
    return orig(ui, source, dest, **opts)
  File "/usr/lib/python3.10/site-packages/mercurial/util.py", line 1888, in
check
    return func(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/mercurial/commands.py", line 1955, in
clone
    r = hg.clone(
  File "/usr/lib/python3.10/site-packages/hgext/largefiles/overrides.py", line
1096, in hgclone
    result = orig(ui, opts, *args, **kwargs)
  File "/usr/lib/python3.10/site-packages/mercurial/hg.py", line 675, in clone
    srcpeer = peer(ui, peeropts, source)
  File "/usr/lib/python3.10/site-packages/mercurial/hg.py", line 244, in peer
    return _peerorrepo(
  File "/usr/lib/python3.10/site-packages/mercurial/hg.py", line 192, in
_peerorrepo
    obj = _peerlookup(path).instance(
  File "/usr/lib/python3.10/site-packages/mercurial/httppeer.py", line 1113, in
instance
    inst = makepeer(ui, path)
  File "/usr/lib/python3.10/site-packages/mercurial/httppeer.py", line 1074, in
makepeer
    respurl, info = performhandshake(ui, url, opener, requestbuilder)
  File "/usr/lib/python3.10/site-packages/mercurial/httppeer.py", line 991, in
performhandshake
    resp = sendrequest(ui, opener, req)
  File "/usr/lib/python3.10/site-packages/mercurial/httppeer.py", line 301, in
sendrequest
    res = opener.open(req)
  File "/usr/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/usr/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.10/urllib/request.py", line 557, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 1056, in http_error_401
    response = self.http_error_auth_reqed('www-authenticate',
  File "/usr/lib/python3.10/site-packages/mercurial/url.py", line 524, in
http_error_auth_reqed
    return urlreq.httpbasicauthhandler.http_error_auth_reqed(
  File "/usr/lib/python3.10/urllib/request.py", line 1005, in
http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
  File "/usr/lib/python3.10/site-packages/mercurial/url.py", line 529, in
retry_http_basic_auth
    user, pw = self.passwd.find_user_password(
  File "/usr/lib/python3.10/site-packages/mercurial/url.py", line 108, in
find_user_password
    self.passwddb.add_password(realm, authuri, user, passwd)
  File "/usr/lib/python3.10/site-packages/mercurial/ui.py", line 189, in
add_password
    _maybestrurl(passwd),
  File "/usr/lib/python3.10/site-packages/mercurial/ui.py", line 166, in
_maybestrurl
    return pycompat.rapply(pycompat.strurl, maybebytes)
  File "/usr/lib/python3.10/site-packages/mercurial/pycompat.py", line 98, in
rapply
    return _rapply(f, xs)
  File "/usr/lib/python3.10/site-packages/mercurial/pycompat.py", line 74, in
_rapply
    return f(xs)
  File "/usr/lib/python3.10/site-packages/mercurial/pycompat.py", line 293, in
strurl
    return url.decode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4: ordinal
not in range(128)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list