no encode method on password as it is bytes in py3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
git-ubuntu |
New
|
Undecided
|
Unassigned | ||
launchpadlib |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
I've seen various cases on my system of this error - on Xenial which my system is, but also on snaps that clearly work for others - so there must be a portion of my "system setup" involved that triggers this I don't see yet.
The issue appears as:
[...]
File "/snap/
'launchpadlib', unique_key, serialized)
File "/snap/
_keyring_
File "/snap/
password_
AttributeError: 'bytes' object has no attribute 'encode
And that essentially is:
/usr/lib/
360 B64MARKER = b"<B64>"
...
382 serialized = self.B64MARKER + b64encode(
383 keyring.
384 'launchpadlib', unique_key, serialized)
...
/usr/lib/
87 password_encrypted = self.encrypt(
Now in python3 b64encode returns bytes and B64MARKER clearly is defined as bytes.
So the object arriving at the encode call is "bytes".
But encode is a method of string not bytes which triggers the error.
I beg your pardon for not (yet) seeing why this hits me but not others.
I almost expect more to be updated on my py-foo than a bug-fix :-/