Merge lp:~leonardr/launchpadlib/avoid-beta-beta into lp:launchpadlib
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~leonardr/launchpadlib/avoid-beta-beta |
Merge into: | lp:launchpadlib |
Diff against target: |
89 lines (+58/-0) 3 files modified
src/launchpadlib/NEWS.txt (+5/-0) src/launchpadlib/launchpad.py (+9/-0) src/launchpadlib/tests/test_launchpad.py (+44/-0) |
To merge this branch: | bzr merge lp:~leonardr/launchpadlib/avoid-beta-beta |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | code | Approve | |
Review via email: mp+20689@code.launchpad.net |
Description of the change
Old versions of launchpadlib took a service root URI argument, and the service URI included "/beta/" at the end. Then we introduced multi-version code, and there was a separate argument for the version, which gets stuck on to the end of the service URI.
Third-party code that used the constants in launchpadlib.uris are safe. But some code didn't use those constants: it hard-coded the URI service root in a string. That code is now going to be making HTTP requests to http://
This branch adds a check to the Launchpad constructor that will catch code like this and complain with a helpful exception. I originally thought I could silently fix this, but the fix would only work so long as the default web service version was 'beta', which won't be much longer. Better to get the problem fixed now.
I'm uncertain about the best way to write a unit test for the message contained in an exception. I think the way I did it is a little hacky. Let me know if there's a better way.
Ah! Looks like I've got some code to change... :)