mercurial_keyring issueshttps://foss.heptapod.net/mercurial/mercurial_keyring/-/issues2023-03-01T20:36:21Zhttps://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/83UnicodeDecodeError when installing 1.4.3 from PyPI on CentOS 7.9 with py3.6.82023-03-01T20:36:21ZMatt HarbisonUnicodeDecodeError when installing 1.4.3 from PyPI on CentOS 7.9 with py3.6.8```
$ python3 -V
Python 3.6.8
$ python3 -m pip -V
pip 21.3.1 from /usr/share/tomcat/.local/lib/python3.6/site-packages/pip (python 3.6)
$ python3 -m pip list | grep setuptools
setuptools 59.6.0
$ python3 -m pip install mercurial_keyring...```
$ python3 -V
Python 3.6.8
$ python3 -m pip -V
pip 21.3.1 from /usr/share/tomcat/.local/lib/python3.6/site-packages/pip (python 3.6)
$ python3 -m pip list | grep setuptools
setuptools 59.6.0
$ python3 -m pip install mercurial_keyring --user -U
Collecting mercurial_keyring
Using cached mercurial_keyring-1.4.3.tar.gz (29 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5y9inm1e/mercurial-keyring_4eb665955d8447419969a58edd77c583/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5y9inm1e/mercurial-keyring_4eb665955d8447419969a58edd77c583/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-jfqcos46
cwd: /tmp/pip-install-5y9inm1e/mercurial-keyring_4eb665955d8447419969a58edd77c583/
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-5y9inm1e/mercurial-keyring_4eb665955d8447419969a58edd77c583/setup.py", line 6, in <module>
LONG_DESCRIPTION = open("README.rst").read()
File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2574: ordinal not in range(128)
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/79/f1/aa99599dd61f2379a70df1f855ce03db7af74c54b8e9bacd0d2ba283008a/mercurial_keyring-1.4.3.tar.gz#sha256=deb5cdfe81f660099efafb0802e194c8ec52f54802b53a812c3565dbce5c83c7 (from https://pypi.org/simple/mercurial-keyring/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Downloading mercurial_keyring-1.4.2.tar.gz (29 kB)
Preparing metadata (setup.py) ... error
ERROR: Command errored out with exit status 1:
....
```
... and it loops discarding the current version, and trying N-1, N-2, ...
I know I've installed from PyPI on other platforms, and I think even other Linux systems with py3.7 or later, so maybe it's a 3.6 issue. But it might be easier to just keep the readme ASCII.https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/81Exception on push with chg2022-03-16T19:54:33ZÉloi RivardException on push with chgWith the `hg` binary everything works as expected, but with `chg` I get the following error with `chg push`. Disabling the extension fixes the issue with `chg`. I use mercurial 6.1 on archlinux.
```python
$ hg push
pushing to xxxxx
** ...With the `hg` binary everything works as expected, but with `chg` I get the following error with `chg push`. Disabling the extension fixes the issue with `chg`. I use mercurial 6.1 on archlinux.
```python
$ hg push
pushing to xxxxx
** Unknown exception encountered with possibly-broken third-party extension "mercurial_keyring" (version N/A)
** which supports versions unknown of Mercurial.
** Please disable "mercurial_keyring" and try your action again.
** If that fixes the bug please report it to https://foss.heptapod.net/mercurial/mercurial_keyring/issues
** Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0]
** Mercurial version 6.1, système de gestion de sources distribué
** Extensions chargées : hgk, mercurial_keyring, mq, pager, patchbomb, purge, rebase, strip
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/mercurial/commandserver.py", line 499, in _serverequest
sv.serve()
File "/usr/lib/python3.10/site-packages/mercurial/commandserver.py", line 403, in serve
while self.serveone():
File "/usr/lib/python3.10/site-packages/mercurial/commandserver.py", line 377, in serveone
handler(self)
File "/usr/lib/python3.10/site-packages/mercurial/chgserver.py", line 583, in runcommand
return super(chgcmdserver, self).runcommand()
File "/usr/lib/python3.10/site-packages/mercurial/commandserver.py", line 358, in runcommand
ret = self._dispatchcommand(req) & 255
File "/usr/lib/python3.10/site-packages/mercurial/commandserver.py", line 297, in _dispatchcommand
return dispatch.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/hgext/pager.py", line 78, in pagecmd
return orig(ui, options, cmd, cmdfunc)
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 1887, in check
return func(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/mercurial/util.py", line 1887, in check
return func(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/hgext/mq.py", line 4239, in mqcommand
return orig(ui, repo, *args, **kwargs)
File "/usr/lib/python3.10/site-packages/mercurial/util.py", line 1887, in check
return func(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/mercurial/commands.py", line 5742, in push
other = hg.peer(repo, opts, dest)
File "/usr/lib/python3.10/site-packages/mercurial/hg.py", line 239, in peer
return _peerorrepo(
File "/usr/lib/python3.10/site-packages/mercurial/hg.py", line 187, in _peerorrepo
obj = _peerlookup(path).instance(
File "/usr/lib/python3.10/site-packages/mercurial/httppeer.py", line 645, in instance
inst = makepeer(ui, path)
File "/usr/lib/python3.10/site-packages/mercurial/httppeer.py", line 629, in makepeer
respurl, info = performhandshake(ui, url, opener, requestbuilder)
File "/usr/lib/python3.10/site-packages/mercurial/httppeer.py", line 568, in performhandshake
resp = sendrequest(ui, opener, req)
File "/usr/lib/python3.10/site-packages/mercurial/httppeer.py", line 288, 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/site-packages/mercurial_keyring.py", line 625, in basic_http_error_auth_reqed
return basic_http_error_auth_reqed.orig(self, authreq, host, req, headers)
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_keyring.py", line 616, in find_user_password
return self._pwd_handler.find_auth(self, realm, authuri, req)
File "/usr/lib/python3.10/site-packages/mercurial_keyring.py", line 432, in find_auth
user, pwd, src, final_url = self.get_credentials(
File "/usr/lib/python3.10/site-packages/mercurial_keyring.py", line 346, in get_credentials
parsed_url, url_user, url_passwd = self.unpack_url(authuri)
File "/usr/lib/python3.10/site-packages/mercurial_keyring.py", line 575, in unpack_url
parsed_url = util.url(authuri)
AttributeError: module 'mercurial.util' has no attribute 'url'
```https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/80[1.4.1] mercurial_keyring sends byte objects as strings, failing Apache authe...2023-03-21T19:07:51ZJeroen Ruigrok van der Werven[1.4.1] mercurial_keyring sends byte objects as strings, failing Apache authenticationUsing mercurial_keyring 1.4.1 when trying to authenticate against an Apache host I consistently fail to authenticate. This results in Mercurial repeating the following bit on the CLI:
```
http authorization required
realm: Mercurial repo...Using mercurial_keyring 1.4.1 when trying to authenticate against an Apache host I consistently fail to authenticate. This results in Mercurial repeating the following bit on the CLI:
```
http authorization required
realm: Mercurial repositories
url: https://hg.example.com
user: username (fixed in hgrc or url)
password:
```
Checking the Apache logfiles shows that the username is sent verbatim as `b'username'`:
```
user `b'username'' in realm `Mercurial repositories' not found: /reponame
```
The same problem occurs with the password, once I had fixed the above:
```
AH01794: user username: password mismatch: /reponame
```
If I patch it with [mercurial_keyring.py.patch](/uploads/23a3e39da393eae129d3ea1b1c904437/mercurial_keyring.py.patch) it solves these problems and I can also use my keyring as intended. I am not 100% sure if these are the right API calls to make, but they seem to make sense.
Relevant Apache configuration section:
```apache
<Location />
AuthType Digest
AuthName "Mercurial repositories"
AuthDigestProvider file
AuthUserFile "/usr/local/hg/hgusers"
Require valid-user
</Location>
```https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/79Authentication failure with hg-git2021-07-06T10:34:03ZjmbAuthentication failure with hg-gitHi,
I have an issue which prevents me from authenticating on my company's internal Gitlab repositories with Mercurial+hg-git. I was able to track it down to Mercurial using `b'username':b'password'` as the credentials instead of `userna...Hi,
I have an issue which prevents me from authenticating on my company's internal Gitlab repositories with Mercurial+hg-git. I was able to track it down to Mercurial using `b'username':b'password'` as the credentials instead of `username:password`.
I reported a bug to hg-git (hg-git#360) and they asked me to report it here since they expect `find_stored_password` to return a unicode string but mercurial_keyring returns a bytes object instead.
Versions:
- mercurial 5.8
- mercurial-keyring 1.4.1
- dulwich 0.20.21
- hg-git 0.10.1
- Python 3.7.3https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/75Keyring stupidly remembers wrong password and never asks it again2021-02-20T18:40:38Zteo1978Keyring stupidly remembers wrong password and never asks it againSteps to reproduce:
- push to a given repository
- when prompted for the password, accidentally type a wrong one. The push will get rejected because of wrong credentials
- push again
Expected: Upon the failed login attempt, the wrong p...Steps to reproduce:
- push to a given repository
- when prompted for the password, accidentally type a wrong one. The push will get rejected because of wrong credentials
- push again
Expected: Upon the failed login attempt, the wrong password shouldn't be stored into the keyring because it has been rejected so it's obviously the wrong password. Therefore, on the second attempt it should prompt for password as if it was the very first time.
Observed: On the first failed login, the password is stupidly stored to the keyring. Therefore, at the next attempt the wrong stored password will be blindly used without prompting the user, and the login will obviously fail, and I'll never be able to push to that repository ever again until I figure out how to manually delete a password that has been stored.https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/68py3 bytes vs str crash on `hg incoming`2021-07-06T10:32:01ZMatt Harbisonpy3 bytes vs str crash on `hg incoming`I'm in WSL with Ubuntu 18.04, py3.6.9, and hg 5.4, but I don't think that matters. Keyring has been complaining about the backend not working, and I really haven't investigating. But HGPLAIN=1 causes a crash:
```
$ HGPLAIN=1 hg in try...I'm in WSL with Ubuntu 18.04, py3.6.9, and hg 5.4, but I don't think that matters. Keyring has been complaining about the backend not working, and I really haven't investigating. But HGPLAIN=1 causes a crash:
```
$ HGPLAIN=1 hg in try
*** failed to import extension mercurial_keyring: unicode 'keyring_check [PATH]' found in cmdtable.keyring_check
*** (use b'' to make it byte string)
Error initializing plugin EntryPoint(name='Windows (alt)', value='keyrings.alt.Windows', group='keyring.backends').
Traceback (most recent call last):
File "/home/mharbison/.local/lib/python3.6/site-packages/keyring/backend.py", line 203, in _load_plugins
init_func = ep.load()
File "/home/mharbison/.local/lib/python3.6/site-packages/importlib_metadata/__init__.py", line 95, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/keyrings/alt/Windows.py", line 9, in <module>
from . import file_base
File "/usr/lib/python3/dist-packages/keyrings/alt/file_base.py", line 13, in <module>
from keyring.util.escape import escape as escape_for_ini
ModuleNotFoundError: No module named 'keyring.util.escape'
Error initializing plugin EntryPoint(name='file', value='keyrings.alt.file', group='keyring.backends').
Traceback (most recent call last):
File "/home/mharbison/.local/lib/python3.6/site-packages/keyring/backend.py", line 203, in _load_plugins
init_func = ep.load()
File "/home/mharbison/.local/lib/python3.6/site-packages/importlib_metadata/__init__.py", line 95, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/keyrings/alt/file.py", line 11, in <module>
from keyring.util.escape import escape as escape_for_ini
ModuleNotFoundError: No module named 'keyring.util.escape'
Error initializing plugin EntryPoint(name='pyfs', value='keyrings.alt.pyfs', group='keyring.backends').
Traceback (most recent call last):
File "/home/mharbison/.local/lib/python3.6/site-packages/keyring/backend.py", line 203, in _load_plugins
init_func = ep.load()
File "/home/mharbison/.local/lib/python3.6/site-packages/importlib_metadata/__init__.py", line 95, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/keyrings/alt/pyfs.py", line 8, in <module>
from keyring.util.escape import escape as escape_for_ini
ModuleNotFoundError: No module named 'keyring.util.escape'
comparing with https://vcs.attotech.com/hg/users/bgrove/golang/atto360
** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0]
** Mercurial Distributed SCM (version 5.4)
** Extensions loaded: extdiff, evolve, topic, phabricator, rebase, absorb, blackbox, strip, show, fix
Traceback (most recent call last):
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 226, in _read_password_from_keyring
password = keyring.get_password(KEYRING_SERVICE, pwdkey)
File "/home/mharbison/.local/lib/python3.6/site-packages/keyring/core.py", line 56, in get_password
return _keyring_backend.get_password(service_name, username)
File "/home/mharbison/.local/lib/python3.6/site-packages/keyring/backends/fail.py", line 25, in get_password
raise NoKeyringError(msg)
keyring.errors.NoKeyringError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/mharbison/.local/bin/hg", line 43, in <module>
dispatch.run()
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 112, in run
status = dispatch(req)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 298, in dispatch
ret = _runcatch(req) or 0
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 472, in _runcatch
return _callcatch(ui, _runcatchfunc)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 481, in _callcatch
return scmutil.callcatch(ui, func)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/scmutil.py", line 152, in callcatch
return func()
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 462, in _runcatchfunc
return _dispatch(req)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 1226, in _dispatch
lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 910, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 1237, in _runcommand
return cmdfunc()
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 1223, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/util.py", line 1864, in check
return func(*args, **kwargs)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/commands.py", line 4373, in incoming
return hg.incoming(ui, repo, source, opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/hg.py", line 1240, in incoming
return _incoming(display, subreporecurse, ui, repo, source, opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/hg.py", line 1198, in _incoming
ui, repo, other, revs, opts[b"bundle"], opts[b"force"]
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/bundlerepo.py", line 549, in getremotechanges
tmp = discovery.findcommonincoming(repo, peer, heads=onlyheads, force=force)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/discovery.py", line 67, in findcommonincoming
ancestorsof=ancestorsof,
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/setdiscovery.py", line 374, in findcommonheads
b'known', {b'nodes': [clnode(r) for r in sample],}
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/wireprotov1peer.py", line 141, in __exit__
self.close()
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/wireprotov1peer.py", line 301, in close
self._responsef.result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/wireprotov1peer.py", line 325, in _readbatchresponse
remoteresult = next(wireresults)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/wireprotov1peer.py", line 580, in _submitbatch
rsp = self._callstream(b"batch", cmds=encodebatchcmds(req))
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/httppeer.py", line 485, in _callstream
resp = sendrequest(self.ui, self._urlopener, req)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/httppeer.py", line 300, in sendrequest
res = opener.open(req)
File "/usr/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.6/urllib/request.py", line 564, in error
result = self._call_chain(*args)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 1035, in http_error_401
url, req, headers)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/url.py", line 514, in http_error_auth_reqed
self, auth_header, host, req, headers
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 616, in basic_http_error_auth_reqed
return basic_http_error_auth_reqed.orig(self, authreq, host, req, headers)
File "/usr/lib/python3.6/urllib/request.py", line 988, in http_error_auth_reqed
return self.retry_http_basic_auth(host, req, realm)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/url.py", line 519, in retry_http_basic_auth
realm, urllibcompat.getfullurl(req)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 607, in find_user_password
return self._pwd_handler.find_auth(self, realm, authuri, req)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 424, in find_auth
pwmgr, realm, authuri, skip_caches=after_bad_auth)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 383, in get_credentials
keyring_pwd = password_store.get_http_password(keyring_url, actual_user)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 177, in get_http_password
self._format_http_key(url, username))
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 231, in _read_password_from_keyring
err))
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/ui.py", line 1736, in warn
self._writemsg(self._fmsgerr, type=b'warning', *msg, **opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/ui.py", line 1220, in _writemsg
_writemsgwith(self._write, dest, *args, **opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/ui.py", line 2335, in _writemsgwith
write(dest, *args, **opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/ui.py", line 1175, in _write
self._writenobuf(dest, *args, **opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/ui.py", line 1181, in _writenobuf
msg = b''.join(args)
TypeError: sequence item 0: expected a bytes-like object, str found
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 57, in apport_excepthook
from cStringIO import StringIO
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 951, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 894, in _find_spec
File "/home/mharbison/.local/lib/python3.6/site-packages/hgdemandimport/demandimportpy3.py", line 102, in find_spec
spec = finder.find_spec(*args, **kwargs)
AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'
Original exception was:
Traceback (most recent call last):
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 226, in _read_password_from_keyring
password = keyring.get_password(KEYRING_SERVICE, pwdkey)
File "/home/mharbison/.local/lib/python3.6/site-packages/keyring/core.py", line 56, in get_password
return _keyring_backend.get_password(service_name, username)
File "/home/mharbison/.local/lib/python3.6/site-packages/keyring/backends/fail.py", line 25, in get_password
raise NoKeyringError(msg)
keyring.errors.NoKeyringError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/mharbison/.local/bin/hg", line 43, in <module>
dispatch.run()
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 112, in run
status = dispatch(req)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 298, in dispatch
ret = _runcatch(req) or 0
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 472, in _runcatch
return _callcatch(ui, _runcatchfunc)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 481, in _callcatch
return scmutil.callcatch(ui, func)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/scmutil.py", line 152, in callcatch
return func()
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 462, in _runcatchfunc
return _dispatch(req)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 1226, in _dispatch
lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 910, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 1237, in _runcommand
return cmdfunc()
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/dispatch.py", line 1223, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/util.py", line 1864, in check
return func(*args, **kwargs)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/commands.py", line 4373, in incoming
return hg.incoming(ui, repo, source, opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/hg.py", line 1240, in incoming
return _incoming(display, subreporecurse, ui, repo, source, opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/hg.py", line 1198, in _incoming
ui, repo, other, revs, opts[b"bundle"], opts[b"force"]
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/bundlerepo.py", line 549, in getremotechanges
tmp = discovery.findcommonincoming(repo, peer, heads=onlyheads, force=force)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/discovery.py", line 67, in findcommonincoming
ancestorsof=ancestorsof,
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/setdiscovery.py", line 374, in findcommonheads
b'known', {b'nodes': [clnode(r) for r in sample],}
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/wireprotov1peer.py", line 141, in __exit__
self.close()
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/wireprotov1peer.py", line 301, in close
self._responsef.result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/usr/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/wireprotov1peer.py", line 325, in _readbatchresponse
remoteresult = next(wireresults)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/wireprotov1peer.py", line 580, in _submitbatch
rsp = self._callstream(b"batch", cmds=encodebatchcmds(req))
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/httppeer.py", line 485, in _callstream
resp = sendrequest(self.ui, self._urlopener, req)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/httppeer.py", line 300, in sendrequest
res = opener.open(req)
File "/usr/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.6/urllib/request.py", line 564, in error
result = self._call_chain(*args)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 1035, in http_error_401
url, req, headers)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/url.py", line 514, in http_error_auth_reqed
self, auth_header, host, req, headers
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 616, in basic_http_error_auth_reqed
return basic_http_error_auth_reqed.orig(self, authreq, host, req, headers)
File "/usr/lib/python3.6/urllib/request.py", line 988, in http_error_auth_reqed
return self.retry_http_basic_auth(host, req, realm)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/url.py", line 519, in retry_http_basic_auth
realm, urllibcompat.getfullurl(req)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 607, in find_user_password
return self._pwd_handler.find_auth(self, realm, authuri, req)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 424, in find_auth
pwmgr, realm, authuri, skip_caches=after_bad_auth)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 383, in get_credentials
keyring_pwd = password_store.get_http_password(keyring_url, actual_user)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 177, in get_http_password
self._format_http_key(url, username))
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial_keyring.py", line 231, in _read_password_from_keyring
err))
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/ui.py", line 1736, in warn
self._writemsg(self._fmsgerr, type=b'warning', *msg, **opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/ui.py", line 1220, in _writemsg
_writemsgwith(self._write, dest, *args, **opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/ui.py", line 2335, in _writemsgwith
write(dest, *args, **opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/ui.py", line 1175, in _write
self._writenobuf(dest, *args, **opts)
File "/home/mharbison/.local/lib/python3.6/site-packages/mercurial/ui.py", line 1181, in _writenobuf
msg = b''.join(args)
TypeError: sequence item 0: expected a bytes-like object, str found
$ pip3 freeze | grep keyring
keyring==21.2.1
keyrings.alt==3.0
mercurial-keyring==1.3.0
```https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/1support HTTP proxy authentication2020-04-07T07:57:06ZBitbucket Importersupport HTTP proxy authentication*Created originally on Bitbucket by Anonymous*
Can I use mercurial_keyring for http proxy authentication? It is not clear from the documentation, and would be a very nice addition.
Thanks for your time,
-- Alexandre*Created originally on Bitbucket by Anonymous*
Can I use mercurial_keyring for http proxy authentication? It is not clear from the documentation, and would be a very nice addition.
Thanks for your time,
-- Alexandre