Title: base64.z85encode should have "pad" parameter · Issue #143103 · python/cpython · GitHub
Open Graph Title: base64.z85encode should have "pad" parameter · Issue #143103 · python/cpython
X Title: base64.z85encode should have "pad" parameter · Issue #143103 · python/cpython
Description: Feature or enhancement Proposal: The documentation of z85encode links to the Z85 specification, which states: The binary frame SHALL have a length that is divisible by 4 with no remainder. Both a85encode and b85encode have a pad paramete...
Open Graph Description: Feature or enhancement Proposal: The documentation of z85encode links to the Z85 specification, which states: The binary frame SHALL have a length that is divisible by 4 with no remainder. Both a85...
X Description: Feature or enhancement Proposal: The documentation of z85encode links to the Z85 specification, which states: The binary frame SHALL have a length that is divisible by 4 with no remainder. Both a85...
Opengraph URL: https://github.com/python/cpython/issues/143103
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"base64.z85encode should have \"pad\" parameter","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nThe [documentation of `z85encode`](https://github.com/python/cpython/blob/f783cc37ebdc2fb9a2b5f967b99caaa886ff4ae4/Doc/library/base64.rst?plain=1#L270) links to [the Z85 specification](https://rfc.zeromq.org/spec/32/#formal-specification), which states:\n\n\u003e The binary frame SHALL have a length that is divisible by 4 with no remainder.\n\nBoth [`a85encode`](https://github.com/python/cpython/blob/f783cc37ebdc2fb9a2b5f967b99caaa886ff4ae4/Lib/base64.py#L323) and [`b85encode`](https://github.com/python/cpython/blob/f783cc37ebdc2fb9a2b5f967b99caaa886ff4ae4/Lib/base64.py#L442) have a `pad` parameter that causes the input to be padded with `b'\\0'` so its length is a multiple of 4 bytes before encoding.\n\n`z85encode` [does not](https://github.com/python/cpython/blob/f783cc37ebdc2fb9a2b5f967b99caaa886ff4ae4/Lib/base64.py#L511) have this parameter, but I think it should, to allow users to more easily meet the Z85 specification.\n\nAdding the parameter is trivial and backcompat issues can be avoided by defaulting it to `False` (like the other two functions). Pull request coming in a few minutes.\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-143106\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/haukex","@type":"Person","name":"haukex"},"datePublished":"2025-12-23T16:06:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/143103/cpython/issues/143103"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5cdfe7e1-4d59-b2a3-eebb-fcfdcc001264 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9A2E:10503:15A1CB6:1C0272B:696B20BB |
| html-safe-nonce | b60bd63a5e77b0c0f088b03706cd95a34647f0e8afe02f7f27db69e9c7dc61af |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QTJFOjEwNTAzOjE1QTFDQjY6MUMwMjcyQjo2OTZCMjBCQiIsInZpc2l0b3JfaWQiOiI4NzY4MDMzNTAzMTUzNDQwNjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 89aeb9592bd78db9b2af6e9c6af1792bdf718e68eda5189e062aa5c4259ae3f4 |
| hovercard-subject-tag | issue:3757829454 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/143103/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e382f4f95d18fc785b5d72ce9c966c1330cbc8b8fb2e3921b5deabecdf81c397/python/cpython/issues/143103 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e382f4f95d18fc785b5d72ce9c966c1330cbc8b8fb2e3921b5deabecdf81c397/python/cpython/issues/143103 |
| og:image:alt | Feature or enhancement Proposal: The documentation of z85encode links to the Z85 specification, which states: The binary frame SHALL have a length that is divisible by 4 with no remainder. Both a85... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | haukex |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width