Issue #74 open

Error with Python 2.6?

Dain Kaplan
created an issue

I followed the directions in the readme, but I got this when I tried to run "hg review --init". I'm running Python 2.6, and Mercurial 1.9.

{{{ Traceback (most recent call last): File "/usr/local/bin/hg", line 38, in <module> mercurial.dispatch.run() File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 16, in run sys.exit(dispatch(sys.argv[1:])) File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 36, in dispatch return _runcatch(u, args) File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 58, in _runcatch return _dispatch(ui, args) File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 590, in _dispatch cmdpats, cmdoptions) File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 401, in runcommand ret = _runcommand(ui, options, cmd, d) File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 641, in _runcommand return checkargs() File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 595, in checkargs return cmdfunc() File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 588, in <lambda> d = lambda: util.checksignature(func)(ui, args, cmdoptions) File "/Library/Python/2.6/site-packages/mercurial/util.py", line 427, in check return func(*args, kwargs) File "/Library/Python/2.6/site-packages/mercurial/extensions.py", line 130, in wrap util.checksignature(origfn), args, kwargs) File "/Library/Python/2.6/site-packages/mercurial/util.py", line 427, in check return func(*args, kwargs) File "/Library/Python/2.6/site-packages/hgext/mq.py", line 2988, in mqcommand return orig(ui, repo, args, kwargs) File "/Library/Python/2.6/site-packages/mercurial/util.py", line 427, in check return func(*args, kwargs) File "/path/to/hg-review/review/cli.py", line 370, in review return _init_command(ui, repo, *opts) File "/path/to/hg-review/review/cli.py", line 93, in _init_command clone_message=True) File "/path/to/hg-review/review/api.py", line 283, in init hg.clone(hg.remoteui(self.ui, {}), {}, self.rpath, self.lpath) File "/Library/Python/2.6/site-packages/mercurial/hg.py", line 227, in clone origsource = source = src_repo.url() AttributeError: 'dict' object has no attribute 'url' }}}

After modifying line 283 in api.py from {{{ hg.clone(hg.remoteui(self.ui, {}), {}, self.rpath, self.lpath) }}} to {{{ hg.clone(hg.remoteui(self.ui, {}), self.rpath, self.lpath) }}} I got the server to start up, but clicking on any change-set throws a 500 error, so I didn't tinker any further.

Comments (3)

  1. Steve Losh repo owner
    • changed status to open

    Are you sure you're running Mercurial 1.9? That line added the extra {} to be compatible with 1.9. Seeing that error should mean you're using an older version of Mercurial.

  2. Stephen Talley

    I'm seeing the same error with Mercurial 1.8.4 and python 2.6.4.

    % hg --version
    Mercurial Distributed SCM (version 1.8.4)
    (see http://mercurial.selenic.com for more information)
    
    Copyright (C) 2005-2011 Matt Mackall and others
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    % python --version
    Python 2.6.4
    
    % hg review --init
    initializing review data from http://bitbucket.org/sjl/hg-review-review
    ** unknown exception encountered, please report by visiting
    **  http://mercurial.selenic.com/wiki/BugTracker
    ** Python 2.6.4 (r264:75706, Jul 20 2011, 20:06:02) [C]
    ** Mercurial Distributed SCM (version 1.8.4)
    ** Extensions loaded: cdm, churn, color, graphlog, mq, pager, review
    Traceback (most recent call last):
      File "/usr/bin/hg", line 38, in <module>
        mercurial.dispatch.run()
      File "/usr/lib/python2.6/vendor-packages/mercurial/dispatch.py", line 16, in run
        sys.exit(dispatch(sys.argv[1:]))
      File "/usr/lib/python2.6/vendor-packages/mercurial/dispatch.py", line 36, in dispatch
        return _runcatch(u, args)
      File "/usr/lib/python2.6/vendor-packages/mercurial/dispatch.py", line 58, in _runcatch
        return _dispatch(ui, args)
      File "/usr/lib/python2.6/vendor-packages/mercurial/dispatch.py", line 601, in _dispatch
        cmdpats, cmdoptions)
      File "/usr/lib/python2.6/vendor-packages/mercurial/dispatch.py", line 406, in runcommand
        ret = _runcommand(ui, options, cmd, d)
      File "/usr/lib/python2.6/vendor-packages/mercurial/extensions.py", line 178, in wrap
        return wrapper(origfn, *args, **kwargs)
      File "/usr/lib/python2.6/vendor-packages/hgext/pager.py", line 106, in pagecmd
        return orig(ui, options, cmd, cmdfunc)
      File "/usr/lib/python2.6/vendor-packages/mercurial/extensions.py", line 178, in wrap
        return wrapper(origfn, *args, **kwargs)
      File "/usr/lib/python2.6/vendor-packages/hgext/color.py", line 223, in colorcmd
        return orig(ui_, opts, cmd, cmdfunc)
      File "/usr/lib/python2.6/vendor-packages/mercurial/dispatch.py", line 655, in _runcommand
        return checkargs()
      File "/usr/lib/python2.6/vendor-packages/mercurial/dispatch.py", line 609, in checkargs
        return cmdfunc()
      File "/usr/lib/python2.6/vendor-packages/mercurial/dispatch.py", line 598, in <lambda>
        d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
      File "/usr/lib/python2.6/vendor-packages/mercurial/util.py", line 433, in check
        return func(*args, **kwargs)
      File "/usr/lib/python2.6/vendor-packages/mercurial/extensions.py", line 133, in wrap
        util.checksignature(origfn), *args, **kwargs)
      File "/usr/lib/python2.6/vendor-packages/mercurial/util.py", line 433, in check
        return func(*args, **kwargs)
      File "/usr/lib/python2.6/vendor-packages/hgext/mq.py", line 3050, in mqcommand
        return orig(ui, repo, *args, **kwargs)
      File "/usr/lib/python2.6/vendor-packages/mercurial/util.py", line 433, in check
        return func(*args, **kwargs)
      File "/home/talley/workspaces/hg-review/review/cli.py", line 370, in review
        return _init_command(ui, repo, **opts)
      File "/home/talley/workspaces/hg-review/review/cli.py", line 93, in _init_command
        clone_message=True)
      File "/home/talley/workspaces/hg-review/review/api.py", line 283, in __init__
        hg.clone(hg.remoteui(self.ui, {}), {}, self.rpath, self.lpath)
      File "/usr/lib/python2.6/vendor-packages/mercurial/hg.py", line 225, in clone
        origsource = source = src_repo.url()
    AttributeError: 'dict' object has no attribute 'url'
    
  3. Log in to comment