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-143103: Added `pad` parameter to `base64.z85encode` by haukex · Pull Request #143106 · python/cpython

Conversation

@haukex

@haukex haukex commented Dec 23, 2025 •
edited by github-actions Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

This makes z85encode analogous to a85encode and b85encode and allows the user to more easily meet the Z85 specification, which requires input lengths to be a multiple of 4. For details see #143103.

Documentation and tests included. Tests were verified against the Z85 reference implementation (which I wrapped into a Python module at haukex/py-z85).

  • Issue: base64.z85encode should have "pad" parameter #143103

📚 Documentation preview 📚: https://cpython-previews--143106.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added the awaiting review label Dec 23, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Dec 23, 2025
base64.z85encode should have "pad" parameter #143103
Closed
@serhiy-storchaka
serhiy-storchaka self-requested a review December 23, 2025 16:29
serhiy-storchaka
serhiy-storchaka reviewed Dec 23, 2025
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2025-12-23-17-07-22.gh-issue-143103.LRjXEW.rst Resolved

Uh oh!

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

Comment thread Lib/test/test_base64.py Resolved

Uh oh!

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

Comment thread Doc/library/base64.rst Resolved

Uh oh!

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

@haukex
haukex force-pushed the z85pad branch from e1ca56f to 6196bc2 Compare December 23, 2025 20:34
@haukex haukex changed the title gh-143103: Added pad argument to base64.z85encode gh-143103: Added pad parameter to base64.z85encode Dec 23, 2025
@haukex

haukex commented Dec 23, 2025

Copy link
Copy Markdown
Contributor Author

All suggested changes applied including correcting "argument" to "parameter" in docs and commit message as well; the force push was just a squash of those changes.

All reactions

Sorry, something went wrong.

Uh oh!

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

@haukex
haukex requested a review from serhiy-storchaka December 23, 2025 21:02
picnixz
picnixz reviewed Dec 24, 2025
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member

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.

I am reviewing on my phone so check my suggestions before committing them (like typos or things like that).

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/base64.py Resolved

Uh oh!

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

Comment thread Misc/NEWS.d/next/Library/2025-12-23-17-07-22.gh-issue-143103.LRjXEW.rst Resolved

Uh oh!

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

@haukex
Added pad parameter to base64.z85encode
db73daa
This makes it analogous to `a85encode` and `b85encode` and allows the
user to more easily meet the Z85 specification, which requires input
lengths to be a multiple of 4.
@haukex
haukex force-pushed the z85pad branch from 9b40347 to db73daa Compare December 24, 2025 10:51
@haukex

haukex commented Dec 24, 2025

Copy link
Copy Markdown
Contributor Author

@picnixz Thanks, I applied the changes and force-pushed the squashed result.

All reactions

Sorry, something went wrong.

Uh oh!

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

@haukex
haukex requested a review from picnixz December 24, 2025 10:52
@picnixz

picnixz commented Dec 24, 2025

Copy link
Copy Markdown
Member

Thanks. In the future do not force push. We squash everything at the end so it doesn't help (it however gets harder for incremental reviews). Force-pushing is reserved when the history got messed up (e.g. bad merge)

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz

picnixz commented Dec 24, 2025

Copy link
Copy Markdown
Member

Looks good but can you add a What's New entry as well for this change? just restate what you did in the NEWS entry (look at Doc/whatsnew/3.15.rst to see what to do). TiA

All reactions

Sorry, something went wrong.

Uh oh!

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

serhiy-storchaka
serhiy-storchaka approved these changes Dec 24, 2025
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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.

LGTM. 👍

Side note. I thought about proposing to make pad a keyword-only parameter. Boolean arguments almost always should be passed by keyword, otherwise it is errorprone if you pass many arguments. This is not applied when the number of parameters is small (like in str.splitlines()), and this may be one of such cases. So I am not sure.

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Dec 24, 2025
@serhiy-storchaka

serhiy-storchaka commented Dec 24, 2025

Copy link
Copy Markdown
Member

AFAIK, not all minor changes deserve an entry in What's New.

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz

picnixz commented Dec 24, 2025

Copy link
Copy Markdown
Member

I also wanted to suggest a kw-only but b85* functions do not have a kw-only and I think it is better to keep similar signatures for the encoding functions.

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz

picnixz commented Dec 24, 2025

Copy link
Copy Markdown
Member

AFAIK, not all minor changes deserve an entry in What's New.

Yeah but I think it is nice to have features there. Otherwise they get burried in the bugfixes as well

All reactions

Sorry, something went wrong.

Uh oh!

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

picnixz
picnixz approved these changes Dec 24, 2025
View reviewed changes

@picnixz picnixz left a comment •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

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.

I also approve this. If you do not want to make the What's New entry it is fine. We can always do it as part of our copy-edit issue. It will also be easier so that you do not need to be careful about where to put the entry and how to format it.

Sorry, something went wrong.

Uh oh!

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

All reactions
@haukex

haukex commented Dec 25, 2025

Copy link
Copy Markdown
Contributor Author

In the future do not force push.

Ok, understood!

If you do not want to make the What's New entry it is fine. We can always do it as part of our copy-edit issue.

The change is pretty small, so I think I'd leave the decision as to whether it's worth adding to the list or not up to you if that's ok.

Thanks very much @serhiy-storchaka and @picnixz! Then the PR is good to go from my side as well.

All reactions

Sorry, something went wrong.

Uh oh!

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

@serhiy-storchaka
serhiy-storchaka merged commit 8d46f96 into python:main Dec 25, 2025
50 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Dec 25, 2025
@haukex
haukex deleted the z85pad branch December 25, 2025 14:24
@serhiy-storchaka

serhiy-storchaka commented Dec 27, 2025

Copy link
Copy Markdown
Member

I will add a What's New entry in #143216. I am planning to add more parameters, so in sum they will be not so small change.

picnixz and haukex reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

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

thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
@haukex @thunder-coding
pythongh-143103: Added pad parameter to base64.z85encode() (pythonGH-…
1c7bcf8
…143106)

This makes it analogous to a85encode() and b85encode() and allows the
user to more easily meet the Z85 specification, which requires input
lengths to be a multiple of 4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes
@picnixz picnixz picnixz approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@haukex @picnixz @serhiy-storchaka
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.