Issue #18011: base64.b32decode() now raises a binascii.Error if there are

non-alphabet characters present in the input string to conform a docstring.
Updated the module documentation.
This commit is contained in:
Serhiy Storchaka 2013-05-28 15:30:38 +03:00
commit 77a3ad743f
4 changed files with 11 additions and 5 deletions

View file

@ -222,7 +222,7 @@ def b32decode(s, casefold=False, map01=None):
for c in quanta:
acc = (acc << 5) + b32rev[c]
except KeyError:
raise TypeError('Non-base32 digit found')
raise binascii.Error('Non-base32 digit found')
decoded += acc.to_bytes(5, 'big')
# Process the last, partial quanta
if padchars: