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 0388fc9 commit 2751372Copy full SHA for 2751372
python/pythonmonkey/builtin_modules/base64.py
@@ -8,10 +8,8 @@
8
9
10
def atob(b64):
11
- # 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')
+ padding = '=' * (4 - (len(b64) & 3))
+ return str(base64.standard_b64decode(b64 + padding), 'latin1')
15
16
17
def btoa(data):
0 commit comments