Can't use relative URLs with launchpadlib.Launchpad - generates URI object that breaks wadllib

Bug #681767 reported by Guilherme Salgado on 2010-11-26
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lazr.restfulclient
Low
Unassigned

Bug Description

I've got a test which looks something like:

  lp = launchpadlib_for("testing", user, version='devel')
  distro = lp.load("/ubuntu")
  series = distro.getSeries(name_or_version='edgy')

The lp.load() call returns the correct object, but the distro.getSeries() call fails with the following:

  File "/home/salgado/devel/launchpad/expose-blueprints/lib/lp/blueprints/tests/test_webservice.py", line 251, in test_distroseries_all_specifications
    name_or_version="maudlin")
  File "/home/salgado/devel/lp-sourcedeps/eggs/lazr.restfulclient-0.10.0-py2.6.egg/lazr/restfulclient/resource.py", line 543, in __call__
    url = self.wadl_method.build_request_url(**args)
  File "/home/salgado/devel/lp-sourcedeps/eggs/wadllib-1.1.5-py2.6.egg/wadllib/application.py", line 585, in build_request_url
    return self.request.build_url(param_values, **kw_param_values)
  File "/home/salgado/devel/lp-sourcedeps/eggs/wadllib-1.1.5-py2.6.egg/wadllib/application.py", line 701, in build_url
    if '?' in url:
TypeError: argument of type 'URI' is not iterable

If instead of using a relative URL I use launchpadlib._root_uri to construct an absolute one, the test pass. This might be a bug in wadllib, but I'm not completely sure that's the case.

Related branches

Gary Poster (gary) on 2010-11-29
Changed in launchpad-foundations:
status: New → Triaged
importance: Undecided → High
Leonard Richardson (leonardr) wrote :

lazr.restfulclient is turning the relative URL into a lazr.uri URI object, but wadllib assumes it's been given a string. We could either make sure a string is passed into wadllib, or make wadllib capable of handling lazr.uri URI objects. If the latter, we could either introduce a lazr.uri dependency, or just stringify a non-string object passed in where wadllib expected a string.

affects: launchpad → launchpadlib
summary: - Can't use relative URLs with launchpadlib.Launchpad reliably
+ Can't use relative URLs with launchpadlib.Launchpad - generates URI
+ object that breaks wadllib
Changed in launchpadlib:
importance: High → Low
Ian Booth (wallyworld) on 2012-04-16
Changed in launchpadlib:
status: Triaged → In Progress
assignee: nobody → Ian Booth (wallyworld)
Ian Booth (wallyworld) wrote :

Retargetting to lazr.restful because resolving this bug requires fixing the lazr.resful source

affects: launchpadlib → lazr.restfulclient
Changed in lazr.restfulclient:
status: In Progress → Triaged
assignee: Ian Booth (wallyworld) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers