-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-144001: Support ignorechars in binascii.a2b_base64() and base64.b64decode() #144024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
gh-144001: Support ignorechars in binascii.a2b_base64() and base64.b64decode() #144024
Conversation
|
This is a draft because I am going to apply the error handling changes in a separate issue first. We can also apply some optimizations -- cache the ignored chars and returning on fast path after ignored characters. |
1b0bb87 to
192d535
Compare
|
Well, the issue with error handling was just that the error message could be more specific in some cases. It is not a bug. It can be included in this PR. |
192d535 to
4f3847e
Compare
| When set to true, bytes that are not part of the base64 standard are | ||
| not allowed. The same applies to excess data after padding (= / ==). | ||
| Set to True by default if ignorechars is specified, False otherwise. | ||
| ignorechars: PyBytesObject = NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we support other types besides bytes? See also #144027.
|
No worries, that was the point I was just free on Sunday, so I push out a PR in case you haven't started on it. BTW your PR looks good, I am no maintainer but you just have to run |
📚 Documentation preview 📚: https://cpython-previews--144024.org.readthedocs.build/