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

Bug #681767 reported by Guilherme Salgado
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
lazr.restfulclient
Triaged
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)
Changed in launchpad-foundations:
status: New → Triaged
importance: Undecided → High
Revision history for this message
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)
Changed in launchpadlib:
status: Triaged → In Progress
assignee: nobody → Ian Booth (wallyworld)
Revision history for this message
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  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.