mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
py3: base64 encoding/decoding returns always bytes don't mix it
Using unicode(bytes) call causes undesired side effect that is inserting `b` character to result. This obviously causes issues with binary base64 data https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
8e139d4b55
commit
caa560ca79
@@ -1036,7 +1036,7 @@ last, after all sets and adds."""),
|
||||
except ValueError:
|
||||
if isinstance(delval, bytes):
|
||||
# This is a Binary value, base64 encode it
|
||||
delval = unicode(base64.b64encode(delval))
|
||||
delval = base64.b64encode(delval).decode('ascii')
|
||||
raise errors.AttrValueNotFound(attr=attr, value=delval)
|
||||
|
||||
# normalize all values
|
||||
|
||||
Reference in New Issue
Block a user