Title: Support multiline output in binascii.b2a_base64() and base64.b64encode() · Issue #143214 · python/cpython · GitHub
Open Graph Title: Support multiline output in binascii.b2a_base64() and base64.b64encode() · Issue #143214 · python/cpython
X Title: Support multiline output in binascii.b2a_base64() and base64.b64encode() · Issue #143214 · python/cpython
Description: Feature or enhancement According to RFC 4648, section 3.1: Implementations MUST NOT add line feeds to base-encoded data unless the specification referring to this document explicitly directs base encoders to add line feeds after a specif...
Open Graph Description: Feature or enhancement According to RFC 4648, section 3.1: Implementations MUST NOT add line feeds to base-encoded data unless the specification referring to this document explicitly directs base e...
X Description: Feature or enhancement According to RFC 4648, section 3.1: Implementations MUST NOT add line feeds to base-encoded data unless the specification referring to this document explicitly directs base e...
Opengraph URL: https://github.com/python/cpython/issues/143214
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support multiline output in binascii.b2a_base64() and base64.b64encode()","articleBody":"# Feature or enhancement\n\nAccording to [RFC 4648, section 3.1](https://datatracker.ietf.org/doc/html/rfc4648#section-3.1):\n\n Implementations MUST NOT add line feeds to base-encoded data unless\n the specification referring to this document explicitly directs base\n encoders to add line feeds after a specific number of characters.\n\nBut many specifications use Base 64 separated on lines of fixed length. The stdlib code contains multiple functions that take the Base 64 data and split it on multiple lines. It is worth to add a special support of this in the base functions that encode to Base 64 -- to improve maintenability (there is a known bug in `email.base64mime.body_encode()`), convenience and performance.\n\nI choose name `wrapcol` for the parameter because it is already used in `base64.a85encode()`. Other (mostly private) functions that implement the Base 64 wrapping use different names: `maxlinelen`, `maxlen`, `max_line_length`. PR #102753 propose name `width` for `binascii.b2a_ascii85()` (it is also used in `textwrap`). So there is no consistency or single dominant option, but I am open for suggestions.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-143216\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/serhiy-storchaka","@type":"Person","name":"serhiy-storchaka"},"datePublished":"2025-12-27T11:47:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/143214/cpython/issues/143214"}
| 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:fd8b7b5e-3737-83fa-0312-e6d1d305cced |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E1E4:F40F2:F9E75D:1567CC6:6969F345 |
| html-safe-nonce | 7b6bdf2552878802f7fbeda8ae1cc4d827548e4f595d2fbd135f6f840ffcd23f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMUU0OkY0MEYyOkY5RTc1RDoxNTY3Q0M2OjY5NjlGMzQ1IiwidmlzaXRvcl9pZCI6IjY5NTgxMjg2MzM3MDQyMTUzNjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1ce4a2c15243a5a2835f01dd0f69f3694a583055a6e058428f0224599d0aea99 |
| hovercard-subject-tag | issue:3764705295 |
| 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/143214/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3aad42c915d152de9fc97db9d158fcf3ac47108a67302a2fc59a73c37aae0294/python/cpython/issues/143214 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3aad42c915d152de9fc97db9d158fcf3ac47108a67302a2fc59a73c37aae0294/python/cpython/issues/143214 |
| og:image:alt | Feature or enhancement According to RFC 4648, section 3.1: Implementations MUST NOT add line feeds to base-encoded data unless the specification referring to this document explicitly directs base e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | serhiy-storchaka |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| 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 | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width