You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-01-05.13:33:45.407>created_at=<Date2019-12-15.17:21:28.531>labels= ['3.7', '3.8', 'type-bug', 'library', '3.9']
title='base64.b64decode() with validate=True does not raise for a trailing \\n'updated_at=<Date2020-01-05.13:33:45.406>user='https://github.com/serhiy-storchaka'
If validate=True is passed to base64.b64decode(), it should raise a binascii.Error if the input contains any character not from the acceptable alphabet.
But it does not raise if the input ends with a single \n. It raises if the input ends with a multiple \n or with any other whitespace character. Only a single \n is accepted.
This is an implementation artifact. A regular exception ending with $ is used to validate an input. But $ matches not only end of string. It matches also an empty string before the trailing \n.
Similar errors are also occurred in other sites. I'll open separate issues for different cases.
New changeset b19c0d7 by Serhiy Storchaka in branch 'master': bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616) b19c0d7
New changeset 3bdb2d9 by Miss Islington (bot) in branch '3.7': bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616) 3bdb2d9
New changeset 34aa3e7 by Miss Islington (bot) in branch '3.8': bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616) 34aa3e7
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: