Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normalize base64 output data in tests #650

Merged
merged 2 commits into from
Aug 20, 2017
Merged

Conversation

minrk
Copy link
Member

@minrk minrk commented Aug 18, 2017

checks for base64 the lazy way, by trying to decode it first.

avoids spurious failure when equivalent base64 data appears changed due to changes in presence of newlines, etc.

cc @takluyver this is the only failure on jack-of-none: https://travis-ci.org/jupyter/test-grid/jobs/266020642

avoids failure when equivalent base64 data appears changed due to changes in presence of newlines, etc.
@mpacer
Copy link
Member

mpacer commented Aug 18, 2017

looks like there's something wrong with python-nightly and gcc, but that the python2 error actually has something to do with the way the base64 was encoded… Seemingly it lost some padding =s at its end?

@minrk
Copy link
Member Author

minrk commented Aug 20, 2017

Should be fixed now.

@mpacer
Copy link
Member

mpacer commented Aug 20, 2017

Sounds good. I still am confused as to why both base64 and binascii exist as separate modules but this fix looks good.

@mpacer mpacer merged commit e1db972 into jupyter:master Aug 20, 2017
@minrk
Copy link
Member Author

minrk commented Aug 21, 2017

From the docs: there are three APIs for base64 encoding in two modules.

  • binascii implements efficient, low-level b2a, a2b encodings, and is meant to be primarily used via other modules
  • base64 provides 'high level' API wrappers around it
  • base64.encode/decodebytes is the 'legacy' API in base64, which encodes base64 as multi-line text
  • base64.b64encode/decode is the 'modern' API (new in Python 2.4), and probably what we should be using in general

@minrk minrk deleted the normalize-base64 branch August 21, 2017 09:58
@mpacer mpacer added this to the 5.3 milestone Aug 26, 2017
@mpacer mpacer added unlogged and removed unlogged labels Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants