mercurial_keyring issueshttps://foss.heptapod.net/mercurial/mercurial_keyring/-/issues2020-04-07T07:57:43Zhttps://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/43error during import of mercurial_keyring2020-04-07T07:57:43ZBitbucket Importererror during import of mercurial_keyring*Created originally on Bitbucket by [alejandrogiacometti (Alejandro Giacometti)](https://bitbucket.org/%7B9887cd79-5348-4afe-a1f0-bd95fc377c15%7D/)*
```
*** failed to import extension mercurial_keyring: vars() argument must have __dict...*Created originally on Bitbucket by [alejandrogiacometti (Alejandro Giacometti)](https://bitbucket.org/%7B9887cd79-5348-4afe-a1f0-bd95fc377c15%7D/)*
```
*** failed to import extension mercurial_keyring: vars() argument must have __dict__ attribute [20/49]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/mercurial/extensions.py", line 100, in loadall
load(ui, name, path)
File "/usr/local/lib/python2.7/site-packages/mercurial/extensions.py", line 87, in load
mod = importh(name)
File "/usr/local/lib/python2.7/site-packages/mercurial/extensions.py", line 77, in importh
mod = __import__(name)
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 115, in _demandimport
return _hgextimport(_import, name, globals, locals, fromlist, level)
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 47, in _hgextimport
return importfunc(name, globals, *args)
File "/usr/local/lib/python2.7/site-packages/mercurial_keyring.py", line 86, in <module>
import keyring
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 115, in _demandimport
return _hgextimport(_import, name, globals, locals, fromlist, level)
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 47, in _hgextimport
return importfunc(name, globals, *args)
File "/usr/local/lib/python2.7/site-packages/keyring/__init__.py", line 12, in <module>
from .core import (set_keyring, get_keyring, set_password, get_password,
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 132, in _demandimport
return _origimport(name, globals, locals, fromlist, level)
File "/usr/local/lib/python2.7/site-packages/keyring/core.py", line 158, in <module>
init_backend()
File "/usr/local/lib/python2.7/site-packages/keyring/core.py", line 57, in init_backend
_load_library_extensions()
File "/usr/local/lib/python2.7/site-packages/keyring/core.py", line 144, in _load_library_extensions
pkg_resources = __import__('pkg_resources')
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 115, in _demandimport
return _hgextimport(_import, name, globals, locals, fromlist, level)
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 47, in _hgextimport
return importfunc(name, globals, *args)
File "/usr/local/lib/python2.7/site-packages/pkg_resources.py", line 80, in <module>
packaging = setuptools._vendor.packaging
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 106, in __getattribute__
self._load()
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 78, in _load
mod = _hgextimport(_import, head, globals, locals, None, level)
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 47, in _hgextimport
return importfunc(name, globals, *args)
File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 12, in <module>
from setuptools.extension import Extension
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 134, in _demandimport
mod = _hgextimport(_origimport, name, globals, locals)
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 47, in _hgextimport
return importfunc(name, globals, *args)
File "/usr/local/lib/python2.7/site-packages/setuptools/extension.py", line 13, in <module>
msvc9_support.patch_for_specialized_compiler()
File "/usr/local/lib/python2.7/site-packages/setuptools/msvc9_support.py", line 24, in patch_for_specialized_compiler
unpatched.update(vars(distutils.msvc9compiler))
TypeError: vars() argument must have __dict__ attribute
```
I thought the error was being caused elsewhere, and reported it.
Here is the setuptools bug report:
https://bitbucket.org/pypa/setuptools/issue/305/error-during-import-of-mercurial-extension
Here is the mercurial bug report:
http://bz.selenic.com/show_bug.cgi?id=4475https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/42IOError 0 encountered in cloning repo with subrepo over https2020-04-07T07:57:42ZBitbucket ImporterIOError 0 encountered in cloning repo with subrepo over https*Created originally on Bitbucket by [banburybill (Jim Hague)](https://bitbucket.org/%7Ba6198ea9-b4a8-4a1c-93eb-b08ff0f5b970%7D/)*
Encountered on Debian Sid x64 when cloning repo containing subrepo over https and using mercurial-keyring ...*Created originally on Bitbucket by [banburybill (Jim Hague)](https://bitbucket.org/%7Ba6198ea9-b4a8-4a1c-93eb-b08ff0f5b970%7D/)*
Encountered on Debian Sid x64 when cloning repo containing subrepo over https and using mercurial-keyring 0.6.2-1.
Disabling mercurial_keyring fixes.
```
#!python
Traceback (most recent call last):
File "/home/jim/work/src/hg/mercurial/dispatch.py", line 140, in _runcatch
return _dispatch(req)
File "/home/jim/work/src/hg/mercurial/dispatch.py", line 850, in _dispatch
cmdpats, cmdoptions)
File "/home/jim/work/src/hg/mercurial/dispatch.py", line 611, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/home/jim/work/src/hg/mercurial/dispatch.py", line 941, in _runcommand
return checkargs()
File "/home/jim/work/src/hg/mercurial/dispatch.py", line 912, in checkargs
return cmdfunc()
File "/home/jim/work/src/hg/mercurial/dispatch.py", line 847, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/home/jim/work/src/hg/mercurial/util.py", line 677, in check
return func(*args, **kwargs)
File "/home/jim/work/src/hg/mercurial/commands.py", line 1371, in clone
branch=opts.get('branch'))
File "/home/jim/work/src/hg/mercurial/hg.py", line 473, in clone
_update(destrepo, uprev)
File "/home/jim/work/src/hg/mercurial/hg.py", line 499, in update
stats = updaterepo(repo, node, False)
File "/home/jim/work/src/hg/mercurial/hg.py", line 495, in updaterepo
labels=['working copy', 'destination'])
File "/home/jim/work/src/hg/mercurial/merge.py", line 1117, in update
stats = applyupdates(repo, actions, wc, p2, overwrite, labels=labels)
File "/home/jim/work/src/hg/mercurial/merge.py", line 652, in applyupdates
for i, item in prog:
File "/home/jim/work/src/hg/mercurial/worker.py", line 124, in _posixworker
for line in fp:
IOError: [Errno 0] Error
abort: Error
```
https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/41demandimport logic is incorrect2020-04-07T07:57:42ZBitbucket Importerdemandimport logic is incorrect*Created originally on Bitbucket by [olliewalsh (Ollie Walsh)](https://bitbucket.org/%7Be2545a43-a234-4b99-8b3d-6c8cdcfb9bdd%7D/)*
The logic for demand import is incorrect. The end result is that demandimport is always enabled after imp...*Created originally on Bitbucket by [olliewalsh (Ollie Walsh)](https://bitbucket.org/%7Be2545a43-a234-4b99-8b3d-6c8cdcfb9bdd%7D/)*
The logic for demand import is incorrect. The end result is that demandimport is always enabled after importing mercurial-keyring, which causes major problems for everything imported afterwards.
```
#!python
# Temporarily disable demandimport to make the need of extending
# the list above less likely.
if __import__ == demandimport._import:
demandimport.disable()
try:
import keyring
finally:
demandimport.enable()
else:
import keyring
```
When demandimport is disabled, `__import__ == demandimport._import`.(http://selenic.com/hg/file/a1eb21f5caea/mercurial/demandimport.py#l43)
That should be: `__import__ == demandimport._demandimport` (http://selenic.com/hg/file/a1eb21f5caea/mercurial/demandimport.py#l170)
https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/40Unknown exception encountered with possibly-broken third-party extension merc...2020-04-07T07:57:41ZBitbucket ImporterUnknown exception encountered with possibly-broken third-party extension mercurial_keyring*Created originally on Bitbucket by [longtimeago (Paul Polishchuk)](https://bitbucket.org/%7B280fd95d-0928-4035-82b6-cd8ccc41a5b1%7D/)*
Hi
I'm using mercurial + mercurial_keyring. After changing repository password I'm not able to clon...*Created originally on Bitbucket by [longtimeago (Paul Polishchuk)](https://bitbucket.org/%7B280fd95d-0928-4035-82b6-cd8ccc41a5b1%7D/)*
Hi
I'm using mercurial + mercurial_keyring. After changing repository password I'm not able to clone repo with mercurial_keyring enabled.
If I disable it and put my password directly to .hgrc all works fine
Please see logs attached.
Thank you!https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/39repeat prompts for keyring password2020-04-07T07:57:40ZBitbucket Importerrepeat prompts for keyring password*Created originally on Bitbucket by [clux (Eirik NA)](https://bitbucket.org/%7B9ebd63ad-9620-4642-8d4b-a22090c39b7c%7D/)*
Hey, I am trying to troubleshoot here a little as I'm finding things have changed after updating to latest mercuri...*Created originally on Bitbucket by [clux (Eirik NA)](https://bitbucket.org/%7B9ebd63ad-9620-4642-8d4b-a22090c39b7c%7D/)*
Hey, I am trying to troubleshoot here a little as I'm finding things have changed after updating to latest mercurial-keyring:
I have a global ~/.hgrc with:
```
[extensions]
mercurial_keyring =
record =
[ui]
username = x <x@y.com>
[auth]
myremote.schemes = https http
myremote.prefix = hg.y.com
myremote.username = z
```
and versions as follows (latest as of now):
```
pip freeze | grep -E "key|merc"
keyring==3.8
mercurial==2.7.2
mercurial-keyring==0.6.2
```
Essentially, I find that every authentication requiring hg interaction now require the keyring password. Two repeat calls to `hg pull` in the same repo will ask for it even if they are just seconds apart.
I'm not sure if there used to be a timer or there was a once per repo thing, but something's different. Has this changed? Is there just a way for it to bug me a bit less?
https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/38g_set_application_name not set2020-04-07T07:57:35ZBitbucket Importerg_set_application_name not set*Created originally on Bitbucket by Anonymous*
when using the single mercurial_keyring.py file as HG extenstion, we get this warning:
** (process:24570): WARNING **: g_set_application_name not set.
in order to solve this, the code n...*Created originally on Bitbucket by Anonymous*
when using the single mercurial_keyring.py file as HG extenstion, we get this warning:
** (process:24570): WARNING **: g_set_application_name not set.
in order to solve this, the code need to be udpated, adding these lines:
import glib
glib.set_application_name('mercurial-keyring')
https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/37g_set_application_name not set2020-04-07T07:57:34ZBitbucket Importerg_set_application_name not set*Created originally on Bitbucket by Anonymous*
when using the single mercurial_keyring.py file as HG extenstion, we get this warning:
** (process:24570): WARNING **: g_set_application_name not set.
in order to solve this, the code n...*Created originally on Bitbucket by Anonymous*
when using the single mercurial_keyring.py file as HG extenstion, we get this warning:
** (process:24570): WARNING **: g_set_application_name not set.
in order to solve this, the code need to be udpated, adding these lines:
>> import glib
>> glib.set_application_name('mercurial-keyring')
https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/36No handlers could be found for logger "keyring"2020-04-07T07:57:34ZBitbucket ImporterNo handlers could be found for logger "keyring"*Created originally on Bitbucket by [charstring (Chris Wesseling)](https://bitbucket.org/%7B51cd9831-a937-4e06-a516-0d1fc43cb8ac%7D/)*
Since upgrading to Fedora 20 I keep getting this error with every mercurial command.
```
$ pip fr...*Created originally on Bitbucket by [charstring (Chris Wesseling)](https://bitbucket.org/%7B51cd9831-a937-4e06-a516-0d1fc43cb8ac%7D/)*
Since upgrading to Fedora 20 I keep getting this error with every mercurial command.
```
$ pip freeze --local| grep keyring
keyring==3.7
mercurial-keyring==0.6.2
$ hg st
No handlers could be found for logger "keyring"
...
```https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/35UnicodeDecodeError when entering password with unicode characters2020-04-07T07:57:33ZBitbucket ImporterUnicodeDecodeError when entering password with unicode characters*Created originally on Bitbucket by Anonymous*
The TortoiseHg team redirected me to mercurial_keyring extension for the source of the following bug.
https://bitbucket.org/tortoisehg/thg/issue/3651
https://bitbucket.org/tortoisehg/th...*Created originally on Bitbucket by Anonymous*
The TortoiseHg team redirected me to mercurial_keyring extension for the source of the following bug.
https://bitbucket.org/tortoisehg/thg/issue/3651
https://bitbucket.org/tortoisehg/thg/issue/3541
When pushing changes in TortoiseHg the type password dialog appears. If the password has unicode characters (in my case it was ä) the push fails with the following error:
** Mercurial version (2.9). TortoiseHg version (2.11)
** Command:
** CWD: C:\Users\7006alex\Documents\MercurialRepos\ValmetHunterUI
** Encoding: cp1252
** Extensions loaded: strip, mq, mercurial_keyring
** Python version: 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)]
** Windows version: sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1')
** Processor architecture: x64
** Qt-4.8.5 PyQt-4.10.3 QScintilla-2.7.2
Traceback (most recent call last):
File "tortoisehg\hgqt\thread.pyo", line 287, in run
File "tortoisehg\util\hglib.pyo", line 711, in dispatch
File "mercurial\dispatch.pyo", line 806, in _dispatch
File "mercurial\dispatch.pyo", line 586, in runcommand
File "mercurial\dispatch.pyo", line 897, in _runcommand
File "mercurial\dispatch.pyo", line 868, in checkargs
File "mercurial\dispatch.pyo", line 803, in <lambda>
File "mercurial\util.pyo", line 511, in check
File "mercurial\extensions.pyo", line 151, in wrap
File "mercurial\util.pyo", line 511, in check
File "hgext\mq.pyo", line 3381, in mqcommand
File "mercurial\util.pyo", line 511, in check
File "mercurial\commands.pyo", line 4729, in push
File "mercurial\localrepo.pyo", line 1880, in push
File "mercurial\wireproto.pyo", line 308, in unbundle
File "mercurial\httppeer.pyo", line 201, in _callpush
File "mercurial\httppeer.pyo", line 171, in _call
File "mercurial\httppeer.pyo", line 118, in _callstream
File "urllib2.pyo", line 410, in open
File "urllib2.pyo", line 523, in http_response
File "urllib2.pyo", line 442, in error
File "urllib2.pyo", line 382, in _call_chain
File "urllib2.pyo", line 897, in http_error_401
File "mercurial\url.pyo", line 440, in http_error_auth_reqed
File "hgext\mercurial_keyring.pyo", line 389, in basic_http_error_auth_reqed
File "urllib2.pyo", line 872, in http_error_auth_reqed
File "urllib2.pyo", line 878, in retry_http_basic_auth
File "hgext\mercurial_keyring.pyo", line 383, in find_user_password
File "hgext\mercurial_keyring.pyo", line 268, in find_auth
File "hgext\mercurial_keyring.pyo", line 121, in set_http_password
File "keyring\core.pyo", line 42, in set_password
File "keyring\backends\Windows.pyo", line 146, in set_password
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 6: ordinal not in range(128)https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/34AssertionError: assert prompt == "/"2020-04-07T07:57:32ZBitbucket ImporterAssertionError: assert prompt == "/"*Created originally on Bitbucket by [Dennis Schridde](https://bitbucket.org/%7Bb0c31e2a-d59d-487d-96a7-edf94431bff3%7D/)*
When I try to pull from a repository that requires authentication, mercurial aborts with an assertion.
```
$ h...*Created originally on Bitbucket by [Dennis Schridde](https://bitbucket.org/%7Bb0c31e2a-d59d-487d-96a7-edf94431bff3%7D/)*
When I try to pull from a repository that requires authentication, mercurial aborts with an assertion.
```
$ hg pull -u
** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.7.3 (default, Sep 26 2013, 20:08:41) [GCC 4.6.3]
** Mercurial Distributed SCM (version 2.0.2)
** Extensions loaded: gpg, pager, graphlog, color, record, mq, fetch, rebase, purge, convert, hgsubversion, hggit, crecord, fastimport, keyring
Traceback (most recent call last):
File "/usr/bin/hg", line 38, in <module>
mercurial.dispatch.run()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 27, in run
sys.exit(dispatch(request(sys.argv[1:])))
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 64, in dispatch
return _runcatch(req)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch
return _dispatch(req)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 684, in _dispatch
cmdpats, cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 466, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 184, in wrap
return wrapper(origfn, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/hgext/color.py", line 373, in colorcmd
return orig(ui_, opts, cmd, cmdfunc)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 184, in wrap
return wrapper(origfn, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/hgext/pager.py", line 107, in pagecmd
return orig(ui, options, cmd, cmdfunc)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 738, in _runcommand
return checkargs()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 692, in checkargs
return cmdfunc()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 681, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 139, in wrap
util.checksignature(origfn), *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/home/$USER/.local/hgext/hgsubversion/hgsubversion/wrappers.py", line 594, in generic
return orig(ui, repo, *args, **opts)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 139, in wrap
util.checksignature(origfn), *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/hgext/rebase.py", line 629, in pullrebase
orig(ui, repo, *args, **opts)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 139, in wrap
util.checksignature(origfn), *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/hgext/mq.py", line 3229, in mqcommand
return orig(ui, repo, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 4226, in pull
other = hg.peer(repo, opts, source)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 184, in wrap
return wrapper(origfn, *args, **kwargs)
File "/home/$USER/.local/hgext/hg-git/hggit/__init__.py", line 188, in peer
newpeer = orig(uiorrepo, *args, **opts)
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 104, in peer
return repository(rui, path, create)
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 93, in repository
repo = _peerlookup(path).instance(ui, path, create)
File "/home/$USER/.local/hgext/hgsubversion/hgsubversion/svnrepo.py", line 190, in instance
return httppeer.instance(ui, url, create)
File "/usr/lib/python2.7/dist-packages/mercurial/httprepo.py", line 236, in instance
inst._fetchcaps()
File "/usr/lib/python2.7/dist-packages/mercurial/httprepo.py", line 57, in _fetchcaps
self.caps = set(self._call('capabilities').split())
File "/usr/lib/python2.7/dist-packages/mercurial/httprepo.py", line 169, in _call
fp = self._callstream(cmd, **args)
File "/usr/lib/python2.7/dist-packages/mercurial/httprepo.py", line 117, in _callstream
resp = self.urlopener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 406, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 438, in error
result = self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 890, in http_error_401
url, req, headers)
File "/usr/lib/python2.7/dist-packages/mercurial/url.py", line 429, in http_error_auth_reqed
self, auth_header, host, req, headers)
File "/home/$USER/.local/hgext/keyring/mercurial_keyring.py", line 389, in basic_http_error_auth_reqed
return basic_http_error_auth_reqed.orig(self, authreq, host, req, headers)
File "/usr/lib/python2.7/urllib2.py", line 865, in http_error_auth_reqed
response = self.retry_http_basic_auth(host, req, realm)
File "/usr/lib/python2.7/urllib2.py", line 871, in retry_http_basic_auth
user, pw = self.passwd.find_user_password(realm, host)
File "/home/$USER/.local/hgext/keyring/mercurial_keyring.py", line 383, in find_user_password
return self._pwd_handler.find_auth(self, realm, authuri, req)
File "/home/$USER/.local/hgext/keyring/mercurial_keyring.py", line 234, in find_auth
pwd = password_store.get_http_password(keyring_url, user)
File "/home/$USER/.local/hgext/keyring/mercurial_keyring.py", line 117, in get_http_password
self._format_http_key(url, username))
File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 37, in get_password
return _keyring_backend.get_password(service_name, username)
File "/usr/lib/python2.7/dist-packages/keyring/backend.py", line 199, in get_password
assert prompt == "/"
AssertionError
```https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/33UnicodeDecodeError when entering password with unicode characters2020-04-07T07:57:31ZBitbucket ImporterUnicodeDecodeError when entering password with unicode characters*Created originally on Bitbucket by [Gamesh (Justinas Urbanavicius)](https://bitbucket.org/%7B0ba18a92-4fee-4ec9-b11f-353a37aaac51%7D/)*
```
#!python
** Mercurial version (2.8.1). TortoiseHg version (2.10.1)
** Command:
...*Created originally on Bitbucket by [Gamesh (Justinas Urbanavicius)](https://bitbucket.org/%7B0ba18a92-4fee-4ec9-b11f-353a37aaac51%7D/)*
```
#!python
** Mercurial version (2.8.1). TortoiseHg version (2.10.1)
** Command:
** CWD: Z:\ituvs\jusurb
** Encoding: cp1257
** Extensions loaded: purge, mercurial_keyring
** Python version: 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
** Windows version: sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, service_pack='')
** Processor architecture: x64
** Qt-4.8.4 PyQt-4.10.2 QScintilla-2.7.2
Traceback (most recent call last):
File "tortoisehg\hgqt\thread.pyo", line 269, in run
File "tortoisehg\util\hglib.pyo", line 708, in dispatch
File "mercurial\dispatch.pyo", line 806, in _dispatch
File "mercurial\dispatch.pyo", line 585, in runcommand
File "mercurial\dispatch.pyo", line 897, in _runcommand
File "mercurial\dispatch.pyo", line 868, in checkargs
File "mercurial\dispatch.pyo", line 803, in <lambda>
File "mercurial\util.pyo", line 512, in check
File "mercurial\commands.pyo", line 4590, in pull
File "mercurial\hg.pyo", line 122, in peer
File "mercurial\hg.pyo", line 102, in _peerorrepo
File "mercurial\httppeer.pyo", line 238, in instance
File "mercurial\httppeer.pyo", line 57, in _fetchcaps
File "mercurial\httppeer.pyo", line 171, in _call
File "mercurial\httppeer.pyo", line 118, in _callstream
File "urllib2.pyo", line 406, in open
File "urllib2.pyo", line 519, in http_response
File "urllib2.pyo", line 438, in error
File "urllib2.pyo", line 378, in _call_chain
File "urllib2.pyo", line 890, in http_error_401
File "mercurial\url.pyo", line 436, in http_error_auth_reqed
File "hgext\mercurial_keyring.pyo", line 389, in basic_http_error_auth_reqed
File "urllib2.pyo", line 865, in http_error_auth_reqed
File "urllib2.pyo", line 878, in retry_http_basic_auth
File "urllib2.pyo", line 406, in open
File "urllib2.pyo", line 519, in http_response
File "urllib2.pyo", line 438, in error
File "urllib2.pyo", line 378, in _call_chain
File "urllib2.pyo", line 890, in http_error_401
File "mercurial\url.pyo", line 436, in http_error_auth_reqed
File "hgext\mercurial_keyring.pyo", line 389, in basic_http_error_auth_reqed
File "urllib2.pyo", line 865, in http_error_auth_reqed
File "urllib2.pyo", line 878, in retry_http_basic_auth
File "urllib2.pyo", line 406, in open
File "urllib2.pyo", line 519, in http_response
File "urllib2.pyo", line 438, in error
File "urllib2.pyo", line 378, in _call_chain
File "urllib2.pyo", line 890, in http_error_401
File "mercurial\url.pyo", line 436, in http_error_auth_reqed
File "hgext\mercurial_keyring.pyo", line 389, in basic_http_error_auth_reqed
File "urllib2.pyo", line 865, in http_error_auth_reqed
File "urllib2.pyo", line 871, in retry_http_basic_auth
File "hgext\mercurial_keyring.pyo", line 383, in find_user_password
File "hgext\mercurial_keyring.pyo", line 268, in find_auth
File "hgext\mercurial_keyring.pyo", line 121, in set_http_password
File "keyring\core.pyo", line 42, in set_password
File "keyring\backends\Windows.pyo", line 146, in set_password
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position 6: ordinal not in range(128)
```https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/32demandimport error - mercurial_keyring Ubuntu 13.102020-04-07T07:57:31ZBitbucket Importerdemandimport error - mercurial_keyring Ubuntu 13.10*Created originally on Bitbucket by Anonymous*
When pull/push
```
#!python
#!python
** Mercurial version (2.7.2). TortoiseHg version (2.9.2)
** Command: --nofork
** CWD: /home/username
** Encoding: UTF-8
...*Created originally on Bitbucket by Anonymous*
When pull/push
```
#!python
#!python
** Mercurial version (2.7.2). TortoiseHg version (2.9.2)
** Command: --nofork
** CWD: /home/username
** Encoding: UTF-8
** Extensions loaded: mercurial_keyring
** Python version: 2.7.5+ (default, Sep 19 2013, 13:48:49) [GCC 4.8.1]
** System: Linux kom085 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64
** Qt-4.8.4 PyQt-4.10.3 QScintilla-2.7.2
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/tortoisehg/hgqt/thread.py", line 283, in run
self.ret = hglib.dispatch(ui, self.cmdline) or 0
File "/usr/lib/python2.7/dist-packages/tortoisehg/util/hglib.py", line 884, in dispatch
return hgdispatch._dispatch(req)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 778, in _dispatch
cmdpats, cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 549, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 869, in _runcommand
return checkargs()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 840, in checkargs
return cmdfunc()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 775, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 507, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 3872, in incoming
return hg.incoming(ui, repo, source, opts)
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 548, in incoming
return _incoming(display, subreporecurse, ui, repo, source, opts)
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 500, in _incoming
other = peer(repo, opts, source)
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 122, in peer
return _peerorrepo(rui, path, create).peer()
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 102, in _peerorrepo
obj = _peerlookup(path).instance(ui, path, create)
File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 238, in instance
inst._fetchcaps()
File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 57, in _fetchcaps
self.caps = set(self._call('capabilities').split())
File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 171, in _call
fp = self._callstream(cmd, **args)
File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 118, in _callstream
resp = self.urlopener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 442, in error
result = self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 897, in http_error_401
url, req, headers)
File "/usr/lib/python2.7/dist-packages/mercurial/url.py", line 431, in http_error_auth_reqed
self, auth_header, host, req, headers)
File "/home/mkrok/.mercurial_keyring.py", line 339, in basic_http_error_auth_reqed
return basic_http_error_auth_reqed.orig(self, authreq, host, req, headers)
File "/usr/lib/python2.7/urllib2.py", line 872, in http_error_auth_reqed
response = self.retry_http_basic_auth(host, req, realm)
File "/usr/lib/python2.7/urllib2.py", line 878, in retry_http_basic_auth
user, pw = self.passwd.find_user_password(realm, host)
File "/home/mkrok/.mercurial_keyring.py", line 333, in find_user_password
return self._pwd_handler.find_auth(self, realm, authuri, req)
File "/home/mkrok/.mercurial_keyring.py", line 184, in find_auth
pwd = password_store.get_http_password(keyring_url, user)
File "/home/mkrok/.mercurial_keyring.py", line 66, in get_http_password
return keyring.get_password(KEYRING_SERVICE,
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 86, in __getattribute__
self._load()
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 58, in _load
mod = _origimport(head, globals, locals)
File "/usr/lib/python2.7/dist-packages/keyring/__init__.py", line 9, in <module>
from core import (set_keyring, get_keyring, set_password, get_password,
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 114, in _demandimport
mod = _origimport(name, globals, locals)
File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 166, in <module>
init_backend()
File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 65, in init_backend
keyrings.sort(key = lambda x: -x.supported())
File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 65, in <lambda>
keyrings.sort(key = lambda x: -x.supported())
File "/usr/lib/python2.7/dist-packages/keyring/backends/Gnome.py", line 18, in supported
from gi.repository import GnomeKeyring
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/usr/lib/python2.7/dist-packages/gi/repository/__init__.py", line 25, in <module>
from ..importer import DynamicImporter
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 112, in _demandimport
return _origimport(name, globals, locals, fromlist, level)
File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 28, in <module>
from .module import DynamicModule
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 112, in _demandimport
return _origimport(name, globals, locals, fromlist, level)
File "/usr/lib/python2.7/dist-packages/gi/module.py", line 271, in <module>
class DynamicModule(types.ModuleType):
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 87, in __getattribute__
return getattr(self._module, attr)
AttributeError: 'module' object has no attribute 'ModuleType'
```https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/31demandimport error - *** failed to import extension mercurial_keyring: 'modul...2020-04-07T07:57:29ZBitbucket Importerdemandimport error - *** failed to import extension mercurial_keyring: 'module' object has no attribute 'system'*Created originally on Bitbucket by [anacrolix (Matt Joiner)](https://bitbucket.org/%7B24aa9e67-83df-4870-8743-42f06446bc9c%7D/)*
```
#!terminal
matt@netbook:~/src/go/src$ pip list | grep keyring
keyring (3.0.1)
mercurial-keyring ...*Created originally on Bitbucket by [anacrolix (Matt Joiner)](https://bitbucket.org/%7B24aa9e67-83df-4870-8743-42f06446bc9c%7D/)*
```
#!terminal
matt@netbook:~/src/go/src$ pip list | grep keyring
keyring (3.0.1)
mercurial-keyring (0.6.0)
```
```
#!terminal
matt@netbook:~/src/go/src$ python2 -c 'import mercurial.demandimport as d; d.enable(); import mercurial_keyring; from mercurial_keyring import PasswordStore'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 114, in _demandimport
mod = _origimport(name, globals, locals)
File "/usr/local/lib/python2.7/dist-packages/mercurial_keyring.py", line 82, in <module>
import keyring
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/usr/local/lib/python2.7/dist-packages/keyring/__init__.py", line 12, in <module>
from .core import (set_keyring, get_keyring, set_password, get_password,
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 112, in _demandimport
return _origimport(name, globals, locals, fromlist, level)
File "/usr/local/lib/python2.7/dist-packages/keyring/core.py", line 166, in <module>
init_backend()
File "/usr/local/lib/python2.7/dist-packages/keyring/core.py", line 58, in init_backend
keyring = load_config()
File "/usr/local/lib/python2.7/dist-packages/keyring/core.py", line 127, in load_config
config_path = os.path.join(platform.data_root(), filename)
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 86, in __getattribute__
self._load()
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 58, in _load
mod = _origimport(head, globals, locals)
File "/usr/local/lib/python2.7/dist-packages/keyring/util/platform.py", line 24, in <module>
data_root = globals().get('_data_root_' + platform.system(), _data_root_Linux)
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 87, in __getattribute__
return getattr(self._module, attr)
AttributeError: 'module' object has no attribute 'system'
```
```
#!terminal
matt@netbook:~/src/go/src$ uname -a
Linux netbook 3.8.0-29-generic #42-Ubuntu SMP Tue Aug 13 19:40:39 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
matt@netbook:~/src/go/src$ hg version
*** failed to import extension mercurial_keyring: 'module' object has no attribute 'system'
Mercurial Distributed SCM (version 2.2.2)
```https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/30demandimport error - ImportError: No module named fs2020-04-07T07:57:28ZBitbucket Importerdemandimport error - ImportError: No module named fs*Created originally on Bitbucket by [Kim_Rydhof_Thor_Hansen (Kim Rydhof Thor Hansen)](https://bitbucket.org/%7B7637022a-4d43-4a89-8d77-4540f74b2fcb%7D/)*
This might be the same problem as #29, but the error is a little different.
I h...*Created originally on Bitbucket by [Kim_Rydhof_Thor_Hansen (Kim Rydhof Thor Hansen)](https://bitbucket.org/%7B7637022a-4d43-4a89-8d77-4540f74b2fcb%7D/)*
This might be the same problem as #29, but the error is a little different.
I have it using Debian unstable with mecurial_keyring directly from the repository.
```
#!
kim@leon:~/ange/baystow/csav$ hg in --traceback
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 97, in _runcatch
return _dispatch(req)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 778, in _dispatch
cmdpats, cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 549, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 869, in _runcommand
return checkargs()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 840, in checkargs
return cmdfunc()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 775, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 506, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 3872, in incoming
return hg.incoming(ui, repo, source, opts)
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 548, in incoming
return _incoming(display, subreporecurse, ui, repo, source, opts)
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 500, in _incoming
other = peer(repo, opts, source)
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 122, in peer
return _peerorrepo(rui, path, create).peer()
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 102, in _peerorrepo
obj = _peerlookup(path).instance(ui, path, create)
File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 238, in instance
inst._fetchcaps()
File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 57, in _fetchcaps
self.caps = set(self._call('capabilities').split())
File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 171, in _call
fp = self._callstream(cmd, **args)
File "/usr/lib/python2.7/dist-packages/mercurial/httppeer.py", line 118, in _callstream
resp = self.urlopener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 410, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 442, in error
result = self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1085, in http_error_401
host, req, headers)
File "/usr/lib/python2.7/dist-packages/mercurial/url.py", line 407, in http_error_auth_reqed
self, auth_header, host, req, headers)
File "/home/kim/.hgext/mercurial_keyring.hg/mercurial_keyring.py", line 394, in digest_http_error_auth_reqed
return digest_http_error_auth_reqed.orig(self, authreq, host, req, headers)
File "/usr/lib/python2.7/urllib2.py", line 970, in http_error_auth_reqed
return self.retry_http_digest_auth(req, authreq)
File "/usr/lib/python2.7/urllib2.py", line 975, in retry_http_digest_auth
auth = self.get_authorization(req, chal)
File "/usr/lib/python2.7/urllib2.py", line 1010, in get_authorization
user, pw = self.passwd.find_user_password(realm, req.get_full_url())
File "/home/kim/.hgext/mercurial_keyring.hg/mercurial_keyring.py", line 380, in find_user_password
return self._pwd_handler.find_auth(self, realm, authuri, req)
File "/home/kim/.hgext/mercurial_keyring.hg/mercurial_keyring.py", line 231, in find_auth
pwd = password_store.get_http_password(keyring_url, user)
File "/home/kim/.hgext/mercurial_keyring.hg/mercurial_keyring.py", line 114, in get_http_password
self._format_http_key(url, username))
File "/usr/lib/python2.7/dist-packages/keyring/core.py", line 36, in get_password
return _keyring_backend.get_password(service_name, username)
File "/usr/lib/python2.7/dist-packages/keyring/backends/pyfs.py", line 167, in get_password
password_base64 = self.config.get(service, username).encode()
File "/usr/lib/python2.7/dist-packages/keyring/backends/pyfs.py", line 152, in config
f = self._open()
File "/usr/lib/python2.7/dist-packages/keyring/backends/pyfs.py", line 97, in _open
except fs.errors.ResourceNotFoundError:
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 86, in __getattribute__
self._load()
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 58, in _load
mod = _origimport(head, globals, locals)
ImportError: No module named fs
abort: No module named fs!
kim@leon:~/ange/baystow/csav$
```https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/29demandimport error - Error on push/pull2020-04-07T07:57:28ZBitbucket Importerdemandimport error - Error on push/pull*Created originally on Bitbucket by [iofik (Vladimir Iofik)](https://bitbucket.org/%7Bb9a9f16e-360a-4bac-8d1b-cc24f4ca93d5%7D/)*
```
#!bash
$ hg pull --traceback
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-...*Created originally on Bitbucket by [iofik (Vladimir Iofik)](https://bitbucket.org/%7Bb9a9f16e-360a-4bac-8d1b-cc24f4ca93d5%7D/)*
```
#!bash
$ hg pull --traceback
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch
return _dispatch(req)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 684, in _dispatch
cmdpats, cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 466, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 184, in wrap
return wrapper(origfn, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/hgext/pager.py", line 107, in pagecmd
return orig(ui, options, cmd, cmdfunc)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 184, in wrap
return wrapper(origfn, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/hgext/color.py", line 373, in colorcmd
return orig(ui_, opts, cmd, cmdfunc)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 738, in _runcommand
return checkargs()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 692, in checkargs
return cmdfunc()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 681, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 139, in wrap
util.checksignature(origfn), *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/hgext/mq.py", line 3229, in mqcommand
return orig(ui, repo, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 139, in wrap
util.checksignature(origfn), *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/hgext/rebase.py", line 629, in pullrebase
orig(ui, repo, *args, **opts)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 458, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 4226, in pull
other = hg.peer(repo, opts, source)
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 104, in peer
return repository(rui, path, create)
File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 93, in repository
repo = _peerlookup(path).instance(ui, path, create)
File "/usr/lib/python2.7/dist-packages/mercurial/httprepo.py", line 236, in instance
inst._fetchcaps()
File "/usr/lib/python2.7/dist-packages/mercurial/httprepo.py", line 57, in _fetchcaps
self.caps = set(self._call('capabilities').split())
File "/usr/lib/python2.7/dist-packages/mercurial/httprepo.py", line 169, in _call
fp = self._callstream(cmd, **args)
File "/usr/lib/python2.7/dist-packages/mercurial/httprepo.py", line 117, in _callstream
resp = self.urlopener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 406, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 438, in error
result = self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 890, in http_error_401
url, req, headers)
File "/usr/lib/python2.7/dist-packages/mercurial/url.py", line 429, in http_error_auth_reqed
self, auth_header, host, req, headers)
File "/usr/local/lib/python2.7/dist-packages/mercurial_keyring.py", line 386, in basic_http_error_auth_reqed
return basic_http_error_auth_reqed.orig(self, authreq, host, req, headers)
File "/usr/lib/python2.7/urllib2.py", line 865, in http_error_auth_reqed
response = self.retry_http_basic_auth(host, req, realm)
File "/usr/lib/python2.7/urllib2.py", line 871, in retry_http_basic_auth
user, pw = self.passwd.find_user_password(realm, host)
File "/usr/local/lib/python2.7/dist-packages/mercurial_keyring.py", line 380, in find_user_password
return self._pwd_handler.find_auth(self, realm, authuri, req)
File "/usr/local/lib/python2.7/dist-packages/mercurial_keyring.py", line 231, in find_auth
pwd = password_store.get_http_password(keyring_url, user)
File "/usr/local/lib/python2.7/dist-packages/mercurial_keyring.py", line 114, in get_http_password
self._format_http_key(url, username))
File "/usr/local/lib/python2.7/dist-packages/keyring/core.py", line 36, in get_password
return _keyring_backend.get_password(service_name, username)
File "/usr/local/lib/python2.7/dist-packages/keyring/backends/Windows.py", line 96, in get_password
res = self._get_password(service)
File "/usr/local/lib/python2.7/dist-packages/keyring/backends/Windows.py", line 111, in _get_password
except pywintypes.error:
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 86, in __getattribute__
self._load()
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 58, in _load
mod = _origimport(head, globals, locals)
ImportError: No module named pywintypes
abort: No module named pywintypes!
```
https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/28demandimport error - mercurial_keyring fails with latest keyring (2.0)2020-04-07T07:57:27ZBitbucket Importerdemandimport error - mercurial_keyring fails with latest keyring (2.0)*Created originally on Bitbucket by [sutupud](https://bitbucket.org/%7Bcff7146a-a20f-433e-880b-8e01916b8b0e%7D/)*
After upgrading keyring to version 2.0 mercurial_keyring stopped working.
After adding some traceback, this is what I'm...*Created originally on Bitbucket by [sutupud](https://bitbucket.org/%7Bcff7146a-a20f-433e-880b-8e01916b8b0e%7D/)*
After upgrading keyring to version 2.0 mercurial_keyring stopped working.
After adding some traceback, this is what I'm getting:
:::none
$ hg push
Traceback (most recent call last):
File "/home/sutu/.local/lib/python2.7/site-packages/mercurial_keyring.py", line 70, in <module>
import keyring
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/__init__.py", line 9, in <module>
from core import (set_keyring, get_keyring, set_password, get_password,
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 114, in _demandimport
mod = _origimport(name, globals, locals)
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/core.py", line 13, in <module>
from keyring import backend
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/backend.py", line 130, in <module>
from keyring.backends.Windows import EncryptedKeyring as Win32CryptoKeyring
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 114, in _demandimport
mod = _origimport(name, globals, locals)
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/backends/Windows.py", line 26, in <module>
from . import _win_crypto
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 112, in _demandimport
return _origimport(name, globals, locals, fromlist, level)
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/backends/_win_crypto.py", line 15, in <module>
class DATA_BLOB(Structure):
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/backends/_win_crypto.py", line 16, in DATA_BLOB
_fields_ = [('cbData', wintypes.DWORD),
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 86, in __getattribute__
self._load()
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 58, in _load
mod = _origimport(head, globals, locals)
File "/usr/lib/python2.7/ctypes/wintypes.py", line 23, in <module>
class VARIANT_BOOL(_SimpleCData):
ValueError: _type_ 'v' not supported
*** failed to import extension mercurial_keyring: _type_ 'v' not supported
Adding `ctypes` to the list of blocked modules for demandimport fixes the problem.
---
update:
Seems the problem is a little more serious then I thought previously, I missed it because I was setting my keyring in keyringrc.conf.
When disabling that, there are more errors:
```
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 88, in loadall
load(ui, name, path)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 75, in load
mod = importh(name)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 65, in importh
mod = __import__(name)
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/home/sutu/.local/lib/python2.7/site-packages/mercurial_keyring.py", line 71, in <module>
import keyring
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/__init__.py", line 9, in <module>
from core import (set_keyring, get_keyring, set_password, get_password,
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 114, in _demandimport
mod = _origimport(name, globals, locals)
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/core.py", line 166, in <module>
init_backend()
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/core.py", line 63, in init_backend
keyrings = backend.get_all_keyring()
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/util/__init__.py", line 24, in wrapper
func.always_returns = func(*args, **kwargs)
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/backend.py", line 119, in get_all_keyring
exceptions=TypeError))
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/util/__init__.py", line 35, in suppress_exceptions
for callable in callables:
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/backend.py", line 111, in is_class_viable
keyring_cls.priority
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/util/properties.py", line 20, in __get__
return self.fget.__get__(None, owner)()
File "/home/sutu/.local/lib/python2.7/site-packages/keyring-2.0-py2.7.egg/keyring/backends/SecretService.py", line 26, in priority
except secretstorage.exceptions.SecretServiceNotAvailableException:
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 86, in __getattribute__
self._load()
File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 58, in _load
mod = _origimport(head, globals, locals)
ImportError: No module named secretstorage
```
Unfortunately I adding `secretstorage` to the block list doesn't help. The only way to fix this I could find is to disable demandimport when importing keyring:
```
from mercurial import demandimport
if __import__ == demandimport._import:
demandimport.disable()
try:
import keyring
finally:
demandimport.enable()
else:
import keyring
```
https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/27demandimport error - atom module has no attribute 'service' error on Mac2020-04-07T07:57:26ZBitbucket Importerdemandimport error - atom module has no attribute 'service' error on Mac*Created originally on Bitbucket by [Kevin Tonon](https://bitbucket.org/%7B1d303d4d-3b35-4f9a-a05d-29d57b8abe84%7D/)*
The keyring module fails to import due to a delayed import of various 'atom' sub-modules.
Adding the following to t...*Created originally on Bitbucket by [Kevin Tonon](https://bitbucket.org/%7B1d303d4d-3b35-4f9a-a05d-29d57b8abe84%7D/)*
The keyring module fails to import due to a delayed import of various 'atom' sub-modules.
Adding the following to the demandimport ignores fixes the issue:
"atom.http",
"atom.http_interface",
"atom.service",
"atom.token_store",
https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/26AttributeError: 'bundlerepository' object has no attribute 'capable'2020-04-07T07:57:25ZBitbucket ImporterAttributeError: 'bundlerepository' object has no attribute 'capable'*Created originally on Bitbucket by [Gili](https://bitbucket.org/%7B28813353-a154-472e-a48a-a5ca553acd57%7D/)*
I invoked the following command-line:
"hg transplant -s http://myrepo.com/hg/myproject"
and hit "y" to transplant a cha...*Created originally on Bitbucket by [Gili](https://bitbucket.org/%7B28813353-a154-472e-a48a-a5ca553acd57%7D/)*
I invoked the following command-line:
"hg transplant -s http://myrepo.com/hg/myproject"
and hit "y" to transplant a changeset. The following exception was thrown:
```
#!python
** Unknown exception encountered with possibly-broken third-party extension mercurial_keyring
** which supports versions unknown of Mercurial.
** Please disable mercurial_keyring and try your action again.
** If that fixes the bug please report it to the extension author.
** Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)]
** Mercurial Distributed SCM (version 2.6.2)
** Extensions loaded: mercurial_keyring, convert, rebase, transplant, mq, histed
it, purge
Traceback (most recent call last):
File "hg", line 42, in <module>
File "mercurial\dispatch.pyo", line 28, in run
File "mercurial\dispatch.pyo", line 69, in dispatch
File "mercurial\dispatch.pyo", line 97, in _runcatch
File "mercurial\dispatch.pyo", line 778, in _dispatch
File "mercurial\dispatch.pyo", line 549, in runcommand
File "mercurial\dispatch.pyo", line 869, in _runcommand
File "mercurial\dispatch.pyo", line 840, in checkargs
File "mercurial\dispatch.pyo", line 775, in <lambda>
File "mercurial\util.pyo", line 506, in check
File "mercurial\extensions.pyo", line 143, in wrap
File "mercurial\util.pyo", line 506, in check
File "hgext\mq.pyo", line 3528, in mqcommand
File "mercurial\util.pyo", line 506, in check
File "hgext\transplant.pyo", line 662, in transplant
File "hgext\transplant.pyo", line 157, in apply
File "mercurial\localrepo.pyo", line 1662, in pull
File "mercurial\discovery.pyo", line 32, in findcommonincoming
AttributeError: 'bundlerepository' object has no attribute 'capable'
```
This extension ships as part of TortoiseHg so I have no way of disabling it. Does the bug lie with mercurial_keyring, TortoiseHg, or Mercurial?https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/25demandimport error - Issue with Google back end2020-04-07T07:57:25ZBitbucket Importerdemandimport error - Issue with Google back end*Created originally on Bitbucket by [alejandrogiacometti (Alejandro Giacometti)](https://bitbucket.org/%7B9887cd79-5348-4afe-a1f0-bd95fc377c15%7D/)*
Mercurial is unable to import keyring due to some error with the gdata back end.
Her...*Created originally on Bitbucket by [alejandrogiacometti (Alejandro Giacometti)](https://bitbucket.org/%7B9887cd79-5348-4afe-a1f0-bd95fc377c15%7D/)*
Mercurial is unable to import keyring due to some error with the gdata back end.
Here is the traceback:
*** failed to import extension mercurial_keyring: 'module' object has no attribute 'service'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/mercurial/extensions.py", line 92, in loadall
load(ui, name, path)
File "/usr/local/lib/python2.7/site-packages/mercurial/extensions.py", line 79, in load
mod = importh(name)
File "/usr/local/lib/python2.7/site-packages/mercurial/extensions.py", line 69, in importh
mod = __import__(name)
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/usr/local/lib/python2.7/site-packages/mercurial_keyring.py", line 61, in <module>
import keyring
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/usr/local/lib/python2.7/site-packages/keyring/__init__.py", line 9, in <module>
from core import (set_keyring, get_keyring, set_password, get_password,
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 114, in _demandimport
mod = _origimport(name, globals, locals)
File "/usr/local/lib/python2.7/site-packages/keyring/core.py", line 166, in <module>
init_backend()
File "/usr/local/lib/python2.7/site-packages/keyring/core.py", line 63, in init_backend
keyrings = backend.get_all_keyring()
File "/usr/local/lib/python2.7/site-packages/keyring/util/__init__.py", line 24, in wrapper
func.always_returns = func(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/keyring/backend.py", line 94, in get_all_keyring
exceptions=TypeError))
File "/usr/local/lib/python2.7/site-packages/keyring/util/__init__.py", line 37, in suppress_exceptions
yield callable()
File "/usr/local/lib/python2.7/site-packages/keyring/backends/Google.py", line 308, in __init__
credential, source, crypter)
File "/usr/local/lib/python2.7/site-packages/keyring/backends/Google.py", line 43, in __init__
DocsService = (__import__('gdata.docs.service')
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/usr/local/lib/python2.7/site-packages/gdata/docs/service.py", line 83, in <module>
class DocsService(gdata.service.GDataService):
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 86, in __getattribute__
self._load()
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 58, in _load
mod = _origimport(head, globals, locals)
File "/usr/local/lib/python2.7/site-packages/gdata/service.py", line 123, in <module>
http_request_handler = atom.service
File "/usr/local/lib/python2.7/site-packages/mercurial/demandimport.py", line 87, in __getattribute__
return getattr(self._module, attr)
AttributeError: 'module' object has no attribute 'service'https://foss.heptapod.net/mercurial/mercurial_keyring/-/issues/24demandimport error - AttributeError: 'module' object has no attribute 'Module...2020-04-07T07:57:24ZBitbucket Importerdemandimport error - AttributeError: 'module' object has no attribute 'ModuleType'*Created originally on Bitbucket by [SimonSapin (Simon Sapin)](https://bitbucket.org/%7B4ee52f1a-7651-4eeb-ba17-af91b458cf0e%7D/)*
Mercurial fails to load the extension:
$ hg --traceback status
*** failed to import extension...*Created originally on Bitbucket by [SimonSapin (Simon Sapin)](https://bitbucket.org/%7B4ee52f1a-7651-4eeb-ba17-af91b458cf0e%7D/)*
Mercurial fails to load the extension:
$ hg --traceback status
*** failed to import extension mercurial_keyring: 'module' object has no attribute 'ModuleType'
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/mercurial/extensions.py", line 92, in loadall
load(ui, name, path)
File "/usr/lib/python2.7/site-packages/mercurial/extensions.py", line 79, in load
mod = importh(name)
File "/usr/lib/python2.7/site-packages/mercurial/extensions.py", line 69, in importh
mod = __import__(name)
File "/usr/lib/python2.7/site-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/home/simon/.local/lib/python2.7/site-packages/mercurial_keyring.py", line 61, in <module>
import keyring
File "/usr/lib/python2.7/site-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/home/simon/.local/lib/python2.7/site-packages/keyring/__init__.py", line 9, in <module>
from core import (set_keyring, get_keyring, set_password, get_password,
File "/usr/lib/python2.7/site-packages/mercurial/demandimport.py", line 114, in _demandimport
mod = _origimport(name, globals, locals)
File "/home/simon/.local/lib/python2.7/site-packages/keyring/core.py", line 166, in <module>
init_backend()
File "/home/simon/.local/lib/python2.7/site-packages/keyring/core.py", line 65, in init_backend
keyrings.sort(key = lambda x: -x.supported())
File "/home/simon/.local/lib/python2.7/site-packages/keyring/core.py", line 65, in <lambda>
keyrings.sort(key = lambda x: -x.supported())
File "/home/simon/.local/lib/python2.7/site-packages/keyring/backends/Gnome.py", line 15, in supported
from gi.repository import GnomeKeyring
File "/usr/lib/python2.7/site-packages/mercurial/demandimport.py", line 95, in _demandimport
return _import(name, globals, locals, fromlist, level)
File "/usr/lib/python2.7/site-packages/gi/repository/__init__.py", line 25, in <module>
from ..importer import DynamicImporter
File "/usr/lib/python2.7/site-packages/mercurial/demandimport.py", line 112, in _demandimport
return _origimport(name, globals, locals, fromlist, level)
File "/usr/lib/python2.7/site-packages/gi/importer.py", line 28, in <module>
from .module import DynamicModule
File "/usr/lib/python2.7/site-packages/mercurial/demandimport.py", line 112, in _demandimport
return _origimport(name, globals, locals, fromlist, level)
File "/usr/lib/python2.7/site-packages/gi/module.py", line 273, in <module>
class DynamicModule(types.ModuleType):
File "/usr/lib/python2.7/site-packages/mercurial/demandimport.py", line 87, in __getattribute__
return getattr(self._module, attr)
AttributeError: 'module' object has no attribute 'ModuleType'
Fiddling with demandimport.py shows that `types` in `types.ModuleType` is the `gi.types` module instead of the stdlib’s `types`. The `from __future__ import absolute_import` line in the same file does not seem to take effect.
On the same system, `python2 -c 'import mercurial_keyring'` runs without an exception.
I though this would reproduce the issue outside of Mercurial, but it didn’t:
python2 -c 'import mercurial.demandimport as d; d.enable(); import mercurial_keyring'
GObject 3.8.2
Python 2.7.5
Mercurial 2.6.2
mercurial_keyring 0.5.5