keyring file-backend reports backtrace with oauth
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
launchpadlib |
Fix Released
|
Undecided
|
Unassigned | ||
python-launchpadlib (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Confirmed
|
Medium
|
Unassigned | ||
Artful |
Confirmed
|
Medium
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Unassigned |
Bug Description
When bringing the importer back up, I ran into the following:
The authorization page:
(<ELIDED>)
should be opening in your browser. Use your browser to authorize
this program to access Launchpad on your behalf.
Waiting to hear from Launchpad about your decision...
Traceback (most recent call last):
File "./bin/usd", line 17, in <module>
main()
File "/home/
args.func(args)
File "/home/
lp = launchpad_
File "/home/
version=
File "/usr/lib/
credential_
File "/usr/lib/
credentials = authorization_
File "/usr/lib/
credential_
File "/usr/lib/
raise e
File "/usr/lib/
self.
File "/usr/lib/
'launchpadlib', unique_key, serialized)
File "/usr/lib/
_keyring_
File "/usr/lib/
password_
AttributeError: 'bytes' object has no attribute 'encode'
cjwatson on IRC suggested this is probably a simple change in launchpadlib:
=== modified file 'src/launchpadl
--- src/launchpadli
+++ src/launchpadli
@@ -380,7 +380,7 @@ class KeyringCredenti
# this problem by base 64 encoding the serialized value.
serialized = self.B64MARKER + b64encode(
- 'launchpadlib', unique_key, serialized)
+ 'launchpadlib', unique_key, serialized.
def do_load(self, unique_key):
which ensures unicode is always passed down, but it needs further testing. It does fix the issue in my particular case.
Related branches
- Colin Watson (community): Approve
- Dimitri John Ledkov: Pending requested
-
Diff: 12 lines (+1/-1)1 file modifiedsrc/launchpadlib/credentials.py (+1/-1)
Changed in python-launchpadlib (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in python-launchpadlib (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in python-launchpadlib (Ubuntu Artful): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in python-launchpadlib (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in launchpadlib: | |
status: | New → Confirmed |
I asked upstream about this, as well: https:/ /github. com/jaraco/ keyrings. alt/issues/ 23, and they confirmed that set_password expects a unicode string, not a base64 encoded string.