Feature or enhancement
Earlier standards for Base64 (RFC 1421, RFC 1521) on which the base64 and binascii modules are based, specified that any non-alphabet characters should be ignored, and this is the default behavior of these modules. More modern standard (RFC 4648) considers this a vulnerability, and specify that they should be rejected until the upper lever document states otherwise. Thus, strict_mode/validate parameters were added. But they are "all-or-nothing" -- either all non-alphabet characters are rejected, or other errors are ignored. In some cases we need to ignore only the part of errors -- for example, ignore newlines and whitespaces, but not other invalid characters, or ignore padding errors.
a85decode() has parameter ignorechars which could also be used to control Base64 decoding.
Linked PRs
Feature or enhancement
Earlier standards for Base64 (RFC 1421, RFC 1521) on which the
base64andbinasciimodules are based, specified that any non-alphabet characters should be ignored, and this is the default behavior of these modules. More modern standard (RFC 4648) considers this a vulnerability, and specify that they should be rejected until the upper lever document states otherwise. Thus,strict_mode/validateparameters were added. But they are "all-or-nothing" -- either all non-alphabet characters are rejected, or other errors are ignored. In some cases we need to ignore only the part of errors -- for example, ignore newlines and whitespaces, but not other invalid characters, or ignore padding errors.a85decode()has parameterignorecharswhich could also be used to control Base64 decoding.Linked PRs