Skip to content

Make Base64 decoding strict by default #148204

@serhiy-storchaka

Description

@serhiy-storchaka

Feature or enhancement

Earlier specifications of Base64 encoding (e.g. RFC 1421, RFC 2045) allowed to ignore any non-alphabetical characters, and that was the behavior of the base64 module. The later specifications (RFC 3548, RFC 4648) require that non-alphabetic characters should be errors, unless opposite is explicitly specified. The Base64 decoder in Python got the option to enable more strict behavior, and now it got option to specify what exactly characters can be ignored.

I think that we should make Base64 decoding strict by default. I am not sure when we should do this, in 3.15 or in future versions. There is no reasonable way to use warnings, they would do more harm.

cc @gpshead

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions