Skip to content

Instantly share code, notes, and snippets.

@florenceyeun
florenceyeun / base64_padding.md
Created October 31, 2016 21:16 — forked from perrygeo/base64_padding.md
Avoiding TypeError: Incorrect padding with Python's base64 encoding

Avoiding padding errors with Python's base64 encoding

>>> import base64
>>> data = '{"u": "test"}'
>>> code = base64.b64encode(data)
>>> code
'eyJ1IjogInRlc3QifQ=='