Makes sense! What that code does with plain text for py3 is base64.encode_as_bytes(plaintext) which results in bytes:
>>> from oslo_serialization import base64 >>> base64.encode_as_bytes('hello') b'aGVsbG8='
Basically what that does is:
>>> base64.b64encode('hello'.encode('utf-8')) b'aGVsbG8='
Makes sense! What that code does with plain text for py3 is base64. encode_ as_bytes( plaintext) which results in bytes:
>>> from oslo_serialization import base64 encode_ as_bytes( 'hello' )
>>> base64.
b'aGVsbG8='
Basically what that does is:
>>> base64. b64encode( 'hello' .encode( 'utf-8' ))
b'aGVsbG8='