Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#31935 closed defect (fixed)

py26-mercurial_keyring @0.4.5 not compatible with mercurial @1.9.3

Reported by: m@… Owned by: anddam (Andrea D'Amore)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: anddam (Andrea D'Amore)
Port: py26-mercurial_keyring

Description

The mercurial_keyring extension as currently present in MacPorts (version 0.4.5) is not compatible with the latest Mercurial version:

** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.7.2 (default, Nov  6 2011, 19:00:13) [GCC 4.2.1 Compatible Apple Clang 3.0 (tags/Apple/clang-211.10.1)]
** Mercurial Distributed SCM (version 1.9.3)
** Extensions loaded: graphlog, convert, mercurial_keyring, progress, info, mq, rebase
Traceback (most recent call last):
  File "/opt/local/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
[...]
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial_keyring.py", line 242, in load_hgrc_auth
    res = readauthforuri(local_ui, base_url)
TypeError: readauthforuri() takes exactly 3 arguments (2 given)

See https://bitbucket.org/Mekk/mercurial_keyring/issue/9/mercurial_keyring-extension-errors-with-hg for more details. It would be great if you could update py26-mercurial_keyring.

Change History (10)

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to and.damore@…

comment:2 Changed 13 years ago by anddam (Andrea D'Amore)

Status: newassigned

I cannot reproduce, I've just cloned, committed and pushed a repository from bitbucket using py26-mercurial_keyring 0.4.5 and mercurial 1.9.3 built with python26 port.

I'll update the package as well but before that please provide a proof of concept of the error and output of 'port installed mercurial'.

comment:3 Changed 13 years ago by m@…

The ports:

$ port installed py26-mercurial_keyring mercurial
The following ports are currently installed:
  mercurial @1.9.3_0 (active)
  py26-mercurial_keyring @0.4.5_0 (active)

Full stacktrace:

$ hg pull
** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.7.2 (default, Nov  6 2011, 19:00:13) [GCC 4.2.1 Compatible Apple Clang 3.0 (tags/Apple/clang-211.10.1)]
** Mercurial Distributed SCM (version 1.9.3)
** Extensions loaded: graphlog, convert, mercurial_keyring, progress, info, mq, rebase, hggit
Traceback (most recent call last):
  File "/opt/local/bin/hg", line 38, in <module>
    mercurial.dispatch.run()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 27, in run
    sys.exit(dispatch(request(sys.argv[1:])))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 64, in dispatch
    return _runcatch(req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 87, in _runcatch
    return _dispatch(req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 688, in _dispatch
    cmdpats, cmdoptions)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 463, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 742, in _runcommand
    return checkargs()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 696, in checkargs
    return cmdfunc()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 685, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/util.py", line 389, in check
    return func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/extensions.py", line 137, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/util.py", line 389, in check
    return func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/hgext/rebase.py", line 610, in pullrebase
    orig(ui, repo, *args, **opts)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/util.py", line 389, in check
    return func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/extensions.py", line 137, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/util.py", line 389, in check
    return func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/hgext/mq.py", line 3218, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/util.py", line 389, in check
    return func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/commands.py", line 3774, in pull
    other = hg.peer(repo, opts, source)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 104, in peer
    return repository(rui, path, create)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 93, in repository
    repo = _peerlookup(path).instance(ui, path, create)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httprepo.py", line 233, in instance
    inst._fetchcaps()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httprepo.py", line 56, in _fetchcaps
    self.caps = set(self._call('capabilities').split())
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httprepo.py", line 166, in _call
    fp = self._callstream(cmd, **args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httprepo.py", line 116, in _callstream
    resp = self.urlopener.open(req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 432, in error
    result = self._call_chain(*args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 884, in http_error_401
    url, req, headers)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/url.py", line 429, in http_error_auth_reqed
    self, auth_header, host, req, headers)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 859, in http_error_auth_reqed
    response = self.retry_http_basic_auth(host, req, realm)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 865, in retry_http_basic_auth
    user, pw = self.passwd.find_user_password(realm, host)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial_keyring.py", line 298, in find_user_password
    return self._pwd_handler.find_auth(self, realm, authuri)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial_keyring.py", line 123, in find_auth
    auth_user, pwd, prefix_url = self.load_hgrc_auth(ui, base_url)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/mercurial_keyring.py", line 242, in load_hgrc_auth
    res = readauthforuri(local_ui, base_url)
TypeError: readauthforuri() takes exactly 3 arguments (2 given)

I just noticed that both Python 2.6 and 2.7 occur in the trace, I'll investigate this...

comment:4 Changed 13 years ago by m@…

I tried

sudo port uninstall py26-mercurial_keyring mercurial py26-hggit
sudo port select --set python python26
sudo port install py26-mercurial_keyring mercurial py26-hggit

but that does not solve the problem.

comment:5 Changed 13 years ago by anddam (Andrea D'Amore)

There's little to investigate, check #27757 and r86604, py26-mercurial_keyring is just for python26 port while mercurial now defaults to python27.

If you want to use mercurial with python use python.version=26 option when installing mercurial

sudo port install mercurial python.version=26

What I'm not sure about is why you're not having a missing extension error, are you possibly using an explicit path to mercurial_keyring.py in your hgrc file rather than

[extensions]
mercurial_keyring = 

?

comment:6 Changed 13 years ago by m@…

As mercurial now defaults to python27, does it make sense to provide a mercurial_keyring port for python26 only? I mean, currently it is not possible to use mercurial_keyring out of the box. Would it be possible to provide a port for python27 (assuming that mercurial_keyring is compatible with python27)?

Regarding the missing missing extension error, I just found out that I had set PYTHONPATH to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages for some reason I do not remember anymore. Of course, in that way the extension gets found, even by python27. Thanks for the hint!

comment:7 in reply to:  6 Changed 13 years ago by anddam (Andrea D'Amore)

Resolution: fixed
Status: assignedclosed

Replying to m@…:

As mercurial now defaults to python27, does it make sense to provide a mercurial_keyring port for python26 only?

It doesn't now, but I wrote the port before Python 2.7 was mercurial 's default.

I mean, currently it is not possible to use mercurial_keyring out of the box. Would it be possible to provide a port for python27 (assuming that mercurial_keyring is compatible with python27)?

I'll switch py26-mercurial_keyring and py26-keyring to python group. I updated port in r86990, you should be able to use mercurial_keyring now by using python.version=26 at mercurial build command.

I wasn't able to reproduce the issue with 0.4.5 and mercurial using python 2.6.

Regarding the missing missing extension error, I just found out that I had set PYTHONPATH to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages for some reason I do not remember anymore. Of course, in that way the extension gets found, even by python27. Thanks for the hint!

That explains why the extension was being found.

comment:8 Changed 13 years ago by m@…

Thanks, after updating I can use the port with

export PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages:

In that way it is not required to re-build mercurial with python.version=26.

comment:9 in reply to:  8 ; Changed 13 years ago by anddam (Andrea D'Amore)

Moved to python portgroup in r87032, mercurial_kerying is available for py2{4,5,6,7}. No Python 3.x for now as keyring module is broken.

Replying to m@…:

Thanks, after updating I can use the port with export PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages:

You may install py27-mercurial_keyring and get rid of PYTHONPATH in order not to merge packages from different versions.

comment:10 in reply to:  9 Changed 13 years ago by m@…

Replying to and.damore@…:

You may install py27-mercurial_keyring and get rid of PYTHONPATH in order not to merge packages from different versions.

Perfect, now it works like a charm. Thank you very much!

Note: See TracTickets for help on using tickets.