Launchpad constructor parameters changed incompatibly in natty

Bug #752095 reported by Martin Pool
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Hydrazine
Fix Released
Critical
Martin Pool
launchpadlib
Won't Fix
High
Unassigned

Bug Description

Hydrazine was calling launchpadlib with

        return Launchpad(credentials, service_root, lplib_cachedir)

which syntax was previously, and still is, recommended by <https://help.launchpad.net/API/launchpadlib>.

It turns out a new parameter was inserted near the start in the version in natty, effectively means this succeeds but the service_root parameter is ignored, so your program actually talks to staging.

revno: 102 [merge]
committer: Leonard Richardson <email address hidden>
branch nick: launchpadlib
timestamp: Mon 2010-12-20 15:01:53 -0500
message:
  [r=benji,EdwinGrubbs] If the OAuth token expires in the middle of a launchpadlib session, retrieve another token rather than crashing.
diff:
...

- def __init__(self, credentials, service_root=uris.STAGING_SERVICE_ROOT,
+ def __init__(self, credentials, authorization_engine,
+ service_root=uris.STAGING_SERVICE_ROOT,
                  cache=None, timeout=None, proxy_info=None,
                  version=DEFAULT_VERSION):
         """Root access to the Launchpad API.

         :param credentials: The credentials used to access Launchpad.
         :type credentials: `Credentials`
+ :param authorization_engine: The object used to get end-user input
+ for authorizing OAuth request tokens. Used when an OAuth
+ access token expires or becomes invalid during a
+ session, or is discovered to be invalid once launchpadlib
+ starts up.
+ :type authorization_engine: `RequestTokenAuthorizationEngine`
         :param service_root: The URL to the root of the web service.

If you want a stable Python API, don't change the parameter order.

Related branches

Martin Pool (mbp)
description: updated
Martin Pool (mbp)
Changed in hydrazine:
status: New → Fix Committed
assignee: nobody → Martin Pool (mbp)
importance: Undecided → Critical
Revision history for this message
Martin Pool (mbp) wrote :

So, on consideration, I don't know if this is going to be worth actually reverting in lplib. Code is already out there; it's getting late to change this in Natty; and hydrazine has a workaround for it. Perhaps it's better to just document it as a break and update the user guide page. And please be more careful in future.

description: updated
Revision history for this message
Max Bowsher (maxb) wrote :

I've written https://help.launchpad.net/API/launchpadlib#launchpadlib%20API%20compatibility documenting this and other failures in compatibility.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 752095] Re: Launchpad constructor parameters changed incompatibly in natty

On 10 April 2011 18:58, Max Bowsher <email address hidden> wrote:
> I've written
> https://help.launchpad.net/API/launchpadlib#launchpadlib%20API%20compatibility
> documenting this and other failures in compatibility.

nice page, shame it exists :}

Curtis Hovey (sinzui)
Changed in launchpadlib:
importance: Undecided → High
Curtis Hovey (sinzui)
Changed in launchpadlib:
status: New → Triaged
Revision history for this message
Martin Pool (mbp) wrote :

will be fixed in the 0.2 release

Changed in hydrazine:
milestone: none → 0.2
status: Fix Committed → Fix Released
Revision history for this message
Robert Collins (lifeless) wrote :

Horse has bolted. We would be further incompatible I suspect if we fixed now; so we need to live with it and do better.

Changed in launchpadlib:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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