Merge lp:~smoser/launchpadlib/trunk.lp-1685962 into lp:launchpadlib

Proposed by Scott Moser
Status: Merged
Merged at revision: 163
Proposed branch: lp:~smoser/launchpadlib/trunk.lp-1685962
Merge into: lp:launchpadlib
Diff against target: 12 lines (+1/-1)
1 file modified
src/launchpadlib/credentials.py (+1/-1)
To merge this branch: bzr merge lp:~smoser/launchpadlib/trunk.lp-1685962
Reviewer Review Type Date Requested Status
Colin Watson Approve
Dimitri John Ledkov Pending
Review via email: mp+341005@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

is launchpadlib python3 only these days? i thought we have a special helper in there somewhere to do these decodes by default. As i believe you want unicode for py2, and string for py3, no?

Revision history for this message
Colin Watson (cjwatson) wrote :

unicode for py2 and string for py3 is exactly what .decode('utf-8') gives you.

This is fine; it's been in my working copy for a while too, but I'd forgotten to actually push it forward :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/launchpadlib/credentials.py'
2--- src/launchpadlib/credentials.py 2016-08-15 10:32:44 +0000
3+++ src/launchpadlib/credentials.py 2018-03-07 10:46:58 +0000
4@@ -380,7 +380,7 @@
5 # this problem by base 64 encoding the serialized value.
6 serialized = self.B64MARKER + b64encode(serialized)
7 keyring.set_password(
8- 'launchpadlib', unique_key, serialized)
9+ 'launchpadlib', unique_key, serialized.decode('utf-8'))
10
11 def do_load(self, unique_key):
12 """Retrieve credentials from the keyring."""

Subscribers

People subscribed via source and target branches