Comment 2 for bug 562626

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 562626] [NEW] please make launchpad.load() work again

On Tue, 13 Apr 2010 22:36:38 -0000, Brian Murray <email address hidden> wrote:
> Public bug reported:
>
> Binary package hint: python-launchpadlib
>
> With the latest version of python-launchpadlib I am unable to use
> launchpad.load() at all. I can work around the issue by changing the
> DEFAULT_VERSION in launchpad.py from "1.0" to "beta" but that's not a
> good solution.
>
> launchpad.load('https://api.edge.launchpad.net/') results in an OOPs and
> a 404
>
> launchpad.load('https://api.edge.launchpad.net/beta/') results in
> AttributeError: 'Entry' object has no attribute 'self_link'
>
> launchpad.load('https://api.edge.launchpad.net/1.0/') gets me
> NotImplementedError: Can't look up definition in another url (https://api.edge.launchpad.net/1.0/#service-root)
>
> launchpad.load(EDGE_SERVICE_ROOT) results in another OOPs and a 404

None of these would have worked before would they? They don't reference
any objects.

You should be able to do

  launchpad.load('https://api.edge.launchpad.net/1.0/ubuntu')

where 1.0 matches the version of the webservice you are using.

Note that doing this is fragile, and launchpad.load should support
relative URIs so that it isn't.

In the meantime you can do

  launchpad.load(str(launchpad._root_uri) + ubuntu)

Thanks,

James