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 1697cb5 commit 1c413e0Copy full SHA for 1c413e0
Lib/base64.py
@@ -462,9 +462,12 @@ def b85decode(b):
462
# Delay the initialization of tables to not waste memory
463
# if the function is never called
464
if _b85dec is None:
465
- _b85dec = [None] * 256
+ # we don't assign to _b85dec directly to avoid issues when
466
+ # multiple threads call this function simultaneously
467
+ _b85dec_tmp = [None] * 256
468
for i, c in enumerate(_b85alphabet):
- _b85dec[c] = i
469
+ _b85dec_tmp[c] = i
470
+ _b85dec = _b85dec_tmp
471
472
b = _bytes_from_decode_data(b)
473
padding = (-len(b)) % 5
0 commit comments