← Back to team overview

launchpad-dev team mailing list archive

Re: how to run close_bugs_from_commits.py

 

Edwin Grubbs <edwin.grubbs@xxxxxxxxxxxxx> writes:
> I've been having tremendous difficulties getting
> close_bugs_from_commits.py to run. I saw that it moved from
> lp-dev-utils to launchpadlib/contrib. I tried running it with the
> lazr.restfulclient egg from lp-sourcecode and with
> lp:lazr.restfulclient, but both gave me this error:
>
> $ PYTHONPATH=../src/:~/canonical/lp-sourcedeps/eggs/lazr.restfulclient-0.9.5-py2.4.egg/:~/canonical/lp-sourcedeps/eggs/lazr.uri-1.0.2-py2.4.egg/:~/canonical/lp-sourcedeps/eggs/oauth-1.0-py2.5.egg/
> python2.5 close_bugs_from_commits.py
>
> Traceback (most recent call last):
>   File "close_bugs_from_commits.py", line 116, in <module>
>     sys.exit(main())
>   File "close_bugs_from_commits.py", line 76, in main
>     projects_links.append(launchpad.projects[project_name].self_link)
>   File "/home/egrubbs/canonical/lp-sourcedeps/eggs/lazr.restfulclient-0.9.5-py2.4.egg/lazr/restfulclient/resource.py",
> line 302, in __getattr__
>     return self.lp_get_parameter(attr)
>   File "/home/egrubbs/canonical/lp-sourcedeps/eggs/lazr.restfulclient-0.9.5-py2.4.egg/lazr/restfulclient/resource.py",
> line 196, in lp_get_parameter
>     param_name + suffix, self.JSON_MEDIA_TYPE)
> TypeError: get_parameter() takes exactly 2 arguments (3 given)
>
> I even tried converting the two lines requiring python2.5 to
> python2.4, so that I could use bin/py to load the dependencies, but I
> got this error.
>
> $ ~/work/trunk/bin/py close_bugs_from_commits.py
>
> Traceback (most recent call last):
>   File "close_bugs_from_commits.py", line 118, in ?
>     sys.exit(main())
>   File "close_bugs_from_commits.py", line 78, in main
>     projects_links.append(launchpad.projects[project_name].self_link)
>   File "/home/egrubbs/canonical/lp-sourcedeps/eggs/lazr.restfulclient-0.9.5-py2.4.egg/lazr/restfulclient/resource.py",
> line 571, in __getattr__
>     return super(Entry, self).__getattr__(name)
>   File "/home/egrubbs/canonical/lp-sourcedeps/eggs/lazr.restfulclient-0.9.5-py2.4.egg/lazr/restfulclient/resource.py",
> line 308, in __getattr__
>     raise AttributeError("'%s' object has no attribute '%s'"
> AttributeError: 'Entry' object has no attribute 'self_link'

Did you get these errors before or after the auth step?

When I run it (from launchpadlib/contrib/), it does the auth step, and
after I click the right button in my browser and then hit Enter back at
the prompt, close_bugs_from_commits.py errors expectedly.  Transcript:

  $ pwd
  /home/kfogel/src/launchpadlib/trunk/contrib
  $ ./close_bugs_from_commits.py
  The authorization page:
     (https://edge.launchpad.net/+authorize-token?oauth_token=N26NG3F4Q5wJ1D1vD6Zl)
  should be opening in your browser. After you have authorized
  this program to access Launchpad on your behalf you should come
  back here and press <Enter> to finish the authentication process.
  
  Traceback (most recent call last):
    File "./close_bugs_from_commits.py", line 116, in <module>
      sys.exit(main())
    File "./close_bugs_from_commits.py", line 72, in main
      branches, project_names = get_config('close_bugs_from_commits.conf')
    File "./close_bugs_from_commits.py", line 53, in get_config
      for name, location in config_parser.items('Branch Locations'))
    File "/usr/lib/python2.6/ConfigParser.py", line 328, in items
      raise NoSectionError(section)
  ConfigParser.NoSectionError: No section: 'Branch Locations'
  $ 

That's fine, since I gave it an invalid config file (the unmodified
sample config).  But my errors does not look like your errors.  What's
different between our two environments?  My python is 2.6.2, could that
be it?

-Karl



Follow ups

References