Can't use relative URLs with launchpadlib.Launchpad - generates URI object that breaks wadllib
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lazr.restfulclient |
Triaged
|
Low
|
Unassigned |
Bug Description
I've got a test which looks something like:
lp = launchpadlib_
distro = lp.load("/ubuntu")
series = distro.
The lp.load() call returns the correct object, but the distro.getSeries() call fails with the following:
File "/home/
name_
File "/home/
url = self.wadl_
File "/home/
return self.request.
File "/home/
if '?' in url:
TypeError: argument of type 'URI' is not iterable
If instead of using a relative URL I use launchpadlib.
Related branches
- Curtis Hovey (community): Approve (code)
-
Diff: 154 lines (+29/-11)5 files modified.bzrignore (+1/-0)
src/lazr/restfulclient/NEWS.txt (+6/-0)
src/lazr/restfulclient/docs/entries.txt (+9/-0)
src/lazr/restfulclient/resource.py (+12/-10)
src/lazr/restfulclient/version.txt (+1/-1)
Changed in launchpad-foundations: | |
status: | New → Triaged |
importance: | Undecided → High |
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 |
Changed in launchpadlib: | |
status: | Triaged → In Progress |
assignee: | nobody → Ian Booth (wallyworld) |
Changed in lazr.restfulclient: | |
status: | In Progress → Triaged |
assignee: | Ian Booth (wallyworld) → nobody |
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.