[07:48] <ePierre> Hi!
[07:48] <ePierre> I'm having troubles using launchpadlib
[07:49] <ePierre> I don't have any token in ~/.launchpadlib/api.launchpad.net/cache/
[07:49] <ePierre> When I do this:
[07:49] <ePierre> lp = Launchpad.login_with('my-script', 'production')
[07:49] <ePierre> and then try to retrieve some data, I have the following crash
[07:49] <wgrant> ePierre: launchpadlib hasn't stored tokens in ~/.launchpadlib for many years. Nowadays it'll use your desktop keyring (eg. gnome-keyring) if you're running from within a DE.
[07:49] <ePierre>   File "/usr/lib/python3/dist-packages/launchpadlib/launchpad.py", line 125, in _bad_oauth_token
[07:49] <ePierre>     (content.startswith("Expired token")
[07:50] <ePierre> wgrant, oh.... it's strange because everytime I launch my script, a file is generated in this directory
[07:50] <wgrant> ePierre: It's a cache of resources from the API, not of credentials.
[07:50] <ePierre> wgrant, and the script was working fine on my colleague's computer until he removed those files
[07:51] <ePierre> wgrant, ok
[07:51] <ePierre> wgrant, if I try to use lp = Launchpad.login_with('my-script'), it works, which means the staging version seems ok
[07:51] <ePierre> but not the production...
[07:52] <wgrant> ePierre: Are you using GNOME or a derivative? Which version of python3-launchpadlib is installed?
[07:52] <ePierre> wgrant, Unity 7 (LTS 16.04)
[07:52] <ePierre> wgrant, and I'm using 1.10.3-3 of python3-launchpadlib
[07:52] <wgrant> ePierre: OK. Open up seahorse and find the api.launchpad.net entry under Passwords > Login.
[07:52] <wgrant> Delete it and rerun your launchpadlib script, and it should prompt you to reauthorise your machine.
[07:54] <ePierre> wgrant, yes, it works... but then it crashes once I authorize it:
[07:55] <ePierre>   File "/usr/lib/python3/dist-packages/launchpadlib/credentials.py", line 251, in from_string
[07:55] <ePierre>     key = params['oauth_token']
[07:55] <ePierre> KeyError: 'oauth_token'
[07:56] <wgrant> ePierre: That looks like https://bugs.launchpad.net/launchpadlib/+bug/1471927. The Python 3 port of launchpadlib is quite immature.
[07:56] <wgrant> It's fixed in 16.10, *or* you can use Python 2 launchpadlib to acquire the token, and then the Python 3 one should be able to use it fine.
[07:56] <wgrant> Or you can hack launchpadlib/credentials.py with the diff from https://code.launchpad.net/~xnox/launchpadlib/fix-1471927/+merge/264480
[07:57] <ePierre> wgrant, indeed it looks like this bug
[07:59] <ePierre> wgrant, thanks for your help! I could generate the token with python2
[08:05] <wgrant> ePierre: Great. Let me know if you run into anything else.
[08:08] <ePierre> wgrant, will do! Thanks :)
[08:34] <ePierre> wgrant, just out of curiosty, the bug you pointed to will not be backported to 16.04?
[14:15] <smoser> as i wait for 'git push' to push like 50M of data...
[14:15] <smoser> is there a way to have launchpad "fork" a git repo for me ?
[14:16] <smoser> ie:
[14:16] <smoser> git clone git://git.launchpad.net/~usd-import-team/ubuntu/+source/isc-dhcp
[14:16] <smoser> git remote add smoser git+ssh://smoser@git.launchpad.net/~smoser/ubuntu/+source/isc-dhcp
[14:16] <smoser> git push smoser
[14:16] <smoser> that pushed 52M up that launchpad already had.
[14:17] <smoser> this was i think magically handled by bzr stacked branches or something in bzr
[14:18] <cjwatson> smoser: It works if the first repository is the default for its target, but you can't do that for package repositories yet
[14:19] <cjwatson> so not yet for package repositories, but it generally works automatically for project repos
[14:19] <cjwatson> we might add an explicit fork action at some point
[14:19] <smoser> ok thanks.
[14:20] <smoser> i probably would have been to  lazy to go to a web page to push the fork button anyway
[14:20] <smoser> but ... if some automation did it for me i'd be happy
[14:21] <cjwatson> the current behaviour is as follows: if there's a default repository for the target, then we clone from that; if you're pushing a new named repository and you already have an owner-target default (e.g. ~smoser/ubuntu/+source/isc-dhcp as opposed to ~smoser/ubuntu/+source/isc-dhcp/+git/embargoed-security-stuff-that-must-not-leak) then we clone from that; otherwise we initialise a new repository