Skip to content

b64encode expects bytes not string#187

Merged
fabianvf merged 1 commit into
openshift:masterfrom
fridex:encode-bytes
Jul 30, 2018
Merged

b64encode expects bytes not string#187
fabianvf merged 1 commit into
openshift:masterfrom
fridex:encode-bytes

Conversation

@fridex
Copy link
Copy Markdown
Contributor

@fridex fridex commented Jul 30, 2018

Fixes: #186

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 30, 2018
@fabianvf
Copy link
Copy Markdown
Member

Nice catch, does this work across the 2/3 boundary?

@fridex
Copy link
Copy Markdown
Contributor Author

fridex commented Jul 30, 2018

Nice catch, does this work across the 2/3 boundary?

Sure:

$ python2
Python 2.7.15 (default, May 16 2018, 17:50:09) 
[GCC 8.1.1 20180502 (Red Hat 8.1.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> from base64 import b64encode
>>> b64encode(json.dumps("{}").encode())
'Int9Ig=='
>>> 
$ python3
Python 3.6.5 (default, Mar 29 2018, 18:20:46) 
[GCC 8.0.1 20180317 (Red Hat 8.0.1-0.19)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> from base64 import b64encode
>>> b64encode(json.dumps("{}").encode())
b'Int9Ig=='
>>> 
$ 

@fabianvf fabianvf merged commit 632a122 into openshift:master Jul 30, 2018
@fridex fridex deleted the encode-bytes branch July 30, 2018 21:55
@fridex
Copy link
Copy Markdown
Contributor Author

fridex commented Jul 30, 2018

@fabianvf could you please issue a new patched release with this fix? I would like to use it. Thanks!

@fridex fridex restored the encode-bytes branch July 31, 2018 19:45
@muff1nman muff1nman mentioned this pull request Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants