Comment 1 for bug 619412

Revision history for this message
John A Meinel (jameinel) wrote : Re: lp-submit redirected me to a page which had a leading '1.0'

I think the recommended name is actually 'lp-propose' now, but it does still have 'lp-submit' as an alias.

Anyway, the issue is probably in:
def canonical_url(object):
    """Return the canonical URL for a branch."""
    scheme, netloc, path, params, query, fragment = urlparse.urlparse(
        str(object.self_link))
    path = '/'.join(path.split('/')[2:])
    netloc = netloc.replace('api.', 'code.')
    return urlparse.urlunparse((scheme, netloc, path, params, query,
                                fragment))

The issue being that 'self_link' is an api.... style url, but that isn't useful for opening a web browser.

In other code in bzr (or hydrazine?) I've seen "url.replace('api.launchpad.net/1.0', 'code.launchpad.net')"

Regardless, I think the *real* fix is to have Launchpad api objects give you a url that you can give to users, rather than trying to fake it in the wrapper code.

I think this can be fixed here, but I think it is also a launchpadlib issue, so I'll add that project.