GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-144001: Add ignorechars parameter to Base64 decoder by moneebullah25 · Pull Request #144009 · python/cpython

Conversation

@moneebullah25

@moneebullah25 moneebullah25 commented Jan 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

  • Add the ignorechars parameter to binascii.a2b_base64() and base64.b64decode()
  • When provided, only characters in this set will be silently ignored during decoding
  • Other non-base64 characters will cause a binascii.Error
  • Similar to the existing ignorechars parameter in base64.a85decode()

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

API

# Ignore only whitespace, reject other invalid chars
base64.b64decode(b'YWJj\n', ignorechars=b'\n')  # OK: b'abc'
base64.b64decode(b'YWJj!', ignorechars=b'\n')   # Error

# Strict: reject all non-base64
base64.b64decode(b'YWJj\n', ignorechars=b'')    # Error

# Default behavior unchanged
base64.b64decode(b'YWJj\n')                      # OK: b'abc' (ignores all)

Closes #144001

  • Issue: Add the ignorechars parameter in the Base64 decoder #144001

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@moneebullah25
pythongh-144001: Add ignorechars parameter to Base64 decoder
2657098
@bedevere-app bedevere-app Bot mentioned this pull request Jan 18, 2026
Add the ignorechars parameter in the Base64 decoder #144001
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Jan 18, 2026
moneebullah25 and others added 5 commits January 18, 2026 17:15
@moneebullah25
pythongh-144001: Register ignorechars identifier in global strings
c4b6a65
@moneebullah25
gh-1440001: Fixed news.d filename
c3f3c2b
@blurb-it
📜🤖 Added by blurb_it.
2e3421c
@moneebullah25
pythongh-144001: removed news entry and blurbed it
5cfb7da
@moneebullah25
docs: added documentation
f8bba19
@moneebullah25
moneebullah25 requested a review from AA-Turner as a code owner January 20, 2026 02:12
@picnixz

picnixz commented Jan 24, 2026

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@picnixz picnixz closed this Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add the ignorechars parameter in the Base64 decoder

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@moneebullah25 @picnixz
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.