/srv/irclogs.ubuntu.com/2016/10/14/#launchpad.txt

=== ganesh is now known as gkadam
ePierreHi!07:48
ePierreI'm having troubles using launchpadlib07:48
ePierreI don't have any token in ~/.launchpadlib/api.launchpad.net/cache/07:49
ePierreWhen I do this:07:49
ePierrelp = Launchpad.login_with('my-script', 'production')07:49
ePierreand then try to retrieve some data, I have the following crash07:49
wgrantePierre: 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_token07:49
ePierre    (content.startswith("Expired token")07:49
ePierrewgrant, oh.... it's strange because everytime I launch my script, a file is generated in this directory07:50
wgrantePierre: It's a cache of resources from the API, not of credentials.07:50
ePierrewgrant, and the script was working fine on my colleague's computer until he removed those files07:50
ePierrewgrant, ok07:51
ePierrewgrant, if I try to use lp = Launchpad.login_with('my-script'), it works, which means the staging version seems ok07:51
ePierrebut not the production...07:51
wgrantePierre: Are you using GNOME or a derivative? Which version of python3-launchpadlib is installed?07:52
ePierrewgrant, Unity 7 (LTS 16.04)07:52
ePierrewgrant, and I'm using 1.10.3-3 of python3-launchpadlib07:52
wgrantePierre: OK. Open up seahorse and find the api.launchpad.net entry under Passwords > Login.07:52
wgrantDelete it and rerun your launchpadlib script, and it should prompt you to reauthorise your machine.07:52
ePierrewgrant, yes, it works... but then it crashes once I authorize it:07:54
ePierre  File "/usr/lib/python3/dist-packages/launchpadlib/credentials.py", line 251, in from_string07:55
ePierre    key = params['oauth_token']07:55
ePierreKeyError: 'oauth_token'07:55
wgrantePierre: That looks like https://bugs.launchpad.net/launchpadlib/+bug/1471927. The Python 3 port of launchpadlib is quite immature.07:56
ubot5Ubuntu bug 1471927 in launchpadlib "AccessToken.from_string() crashes on python3" [Undecided,Fix committed]07:56
wgrantIt'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
wgrantOr you can hack launchpadlib/credentials.py with the diff from https://code.launchpad.net/~xnox/launchpadlib/fix-1471927/+merge/26448007:56
ePierrewgrant, indeed it looks like this bug07:57
ePierrewgrant, thanks for your help! I could generate the token with python207:59
wgrantePierre: Great. Let me know if you run into anything else.08:05
ePierrewgrant, will do! Thanks :)08:08
ePierrewgrant, just out of curiosty, the bug you pointed to will not be backported to 16.04?08:34
smoseras i wait for 'git push' to push like 50M of data...14:15
smoseris there a way to have launchpad "fork" a git repo for me ?14:15
smoserie:14:16
smosergit clone git://git.launchpad.net/~usd-import-team/ubuntu/+source/isc-dhcp14:16
smosergit remote add smoser git+ssh://smoser@git.launchpad.net/~smoser/ubuntu/+source/isc-dhcp14:16
smosergit push smoser14:16
smoserthat pushed 52M up that launchpad already had.14:16
smoserthis was i think magically handled by bzr stacked branches or something in bzr14:17
cjwatsonsmoser: It works if the first repository is the default for its target, but you can't do that for package repositories yet14:18
cjwatsonso not yet for package repositories, but it generally works automatically for project repos14:19
cjwatsonwe might add an explicit fork action at some point14:19
smoserok thanks.14:19
smoseri probably would have been to  lazy to go to a web page to push the fork button anyway14:20
smoserbut ... if some automation did it for me i'd be happy14:20
cjwatsonthe 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 repository14:21
=== nacc_ is now known as nacc
=== Spads_ is now known as Spads
=== xnox_ is now known as xnox
=== om26er_ is now known as om26er
=== thomi_ is now known as thomi
=== iphutch_ is now known as iphutch
=== dobey_ is now known as dobey
=== aendrew_ is now known as aendrew
=== cjwatson_ is now known as cjwatson
=== verterok` is now known as verterok

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!