We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5fc6ce0 commit 2923828Copy full SHA for 2923828
python/pythonmonkey/builtin_modules/base64.py
@@ -8,7 +8,10 @@
8
9
10
def atob(b64):
11
- return str(base64.standard_b64decode(b64), 'latin1')
+ # Workaround for pythons 'Incorrect padding' error when base64 decoding, see:
12
+ # https://stackoverflow.com/questions/2941995/python-ignore-incorrect-padding-error-when-base64-decoding
13
+ append = b"==" if isinstance(b64, bytes) else "=="
14
+ return str(base64.standard_b64decode(b64 + append), 'latin1')
15
16
17
def btoa(data):
0 commit comments