Skip to content

Commit c2de958

Browse files
authored
Merge pull request #403 from Ciarands/main
fix: base64.py 'Incorrect padding' error
2 parents 920d65f + 2751372 commit c2de958

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/pythonmonkey/builtin_modules/base64.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99

1010
def atob(b64):
11-
return str(base64.standard_b64decode(b64), 'latin1')
11+
padding = '=' * (4 - (len(b64) & 3))
12+
return str(base64.standard_b64decode(b64 + padding), 'latin1')
1213

1314

1415
def btoa(data):

0 commit comments

Comments
 (0)