Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-144001: Add ignorechars parameter to Base64 decoder#144009

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@moneebullah25
Copy link
Contributor

@moneebullah25moneebullah25 commentedJan 18, 2026
edited
Loading

Summary

  • Add theignorechars parameter tobinascii.a2b_base64() andbase64.b64decode()
  • When provided, only characters in this set will be silently ignored during decoding
  • Other non-base64 characters will cause abinascii.Error
  • Similar to the existingignorechars parameter inbase64.a85decode()

This addresses the feature request in#144001 where the existingstrict_mode/validate parameters are "all-or-nothing" - either all non-alphabet characters are rejected, or all are ignored. The newignorechars parameter allows selective filtering (e.g., ignoring whitespace while rejecting other invalid characters).

API

# Ignore only whitespace, reject other invalid charsbase64.b64decode(b'YWJj\n',ignorechars=b'\n')# OK: b'abc'base64.b64decode(b'YWJj!',ignorechars=b'\n')# Error# Strict: reject all non-base64base64.b64decode(b'YWJj\n',ignorechars=b'')# Error# Default behavior unchangedbase64.b64decode(b'YWJj\n')# OK: b'abc' (ignores all)

Closes#144001

@picnixz
Copy link
Member

Closing since we will likely prefer Serhiy's PR for that. Thanks for the suggestion.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@AA-TurnerAA-TurnerAwaiting requested review from AA-TurnerAA-Turner is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add the ignorechars parameter in the Base64 decoder

2 participants

@moneebullah25@picnixz

[8]ページ先頭

©2009-2026 Movatter.jp