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-144125: email: verify headers are sound in BytesGenerator by sethmlarson · Pull Request #144126 · python/cpython

Conversation

@sethmlarson

@sethmlarson sethmlarson commented Jan 21, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

GH-122233 added an implementation to Generator to refuse to serialize (write) headers that are unsafely folded or delimited.

This revision adds the same implementation to BytesGenerator, so it gets the same safety protections for unsafely folded or delimited headers

  • Issue: Encode newlines in headers when using ByteGenerator #144125

Sorry, something went wrong.

Uh oh!

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

All reactions
@sethmlarson
sethmlarson requested a review from a team as a code owner January 21, 2026 19:15
@sethmlarson sethmlarson added type-security A security issue stdlib Standard Library Python modules in the Lib/ directory topic-email labels Jan 21, 2026
@bedevere-app bedevere-app Bot added the awaiting review label Jan 21, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Jan 21, 2026
Encode newlines in headers when using ByteGenerator #144125
Closed
@sethmlarson
sethmlarson requested a review from bitdancer January 21, 2026 19:16
@beledouxdenis @encukou
@basbloemsaat @sethmlarson
pythongh-144125: email: verify headers are sound in BytesGenerator
1132e45
pythonGH-122233 added an implementation to `Generator`
to refuse to serialize (write) headers that
are unsafely folded or delimited.

This revision adds the same implementation
to `BytesGenerator`, so it gets the same safety protections
for unsafely folded or delimited headers

Co-authored-by: Denis Ledoux <[email protected]>
Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Bas Bloemsaat <[email protected]>
@sethmlarson
sethmlarson force-pushed the email-verify-headers-in-bytesgenerator branch from cd41a69 to 1132e45 Compare January 21, 2026 19:17
@sethmlarson
Fix ref in NEWS
4a5845c
bitdancer
bitdancer requested changes Jan 21, 2026
View reviewed changes
Comment thread Lib/test/test_email/test_generator.py Resolved

Uh oh!

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

Comment thread Lib/test/test_email/test_policy.py Resolved

Uh oh!

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

@bedevere-app bedevere-app Bot added awaiting changes and removed awaiting review labels Jan 21, 2026
@bedevere-app

bedevere-app Bot commented Jan 21, 2026

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be poked with soft cushions!

All reactions

Sorry, something went wrong.

Uh oh!

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

@sethmlarson
Convert test docstrings to comments
697163b
@sethmlarson

sethmlarson commented Jan 22, 2026

Copy link
Copy Markdown
Contributor Author

@bitdancer I have made the requested changes; please review again

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot added awaiting change review and removed awaiting changes labels Jan 22, 2026
@bedevere-app

bedevere-app Bot commented Jan 22, 2026

Copy link
Copy Markdown

Thanks for making the requested changes!

@bitdancer: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app
bedevere-app Bot requested a review from bitdancer January 22, 2026 15:18
bitdancer
bitdancer approved these changes Jan 23, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting change review labels Jan 23, 2026
@sethmlarson
sethmlarson merged commit 052e55e into python:main Jan 23, 2026
92 of 100 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Jan 23, 2026
@sethmlarson
sethmlarson deleted the email-verify-headers-in-bytesgenerator branch January 23, 2026 14:59
@sethmlarson sethmlarson added needs backport to 3.10 needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes labels Jan 23, 2026
@sethmlarson sethmlarson added the needs backport to 3.14 bugs and security fixes label Jan 23, 2026
@miss-islington-app

miss-islington-app Bot commented Jan 23, 2026

Copy link
Copy Markdown

Thanks @sethmlarson for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app

miss-islington-app Bot commented Jan 23, 2026

Copy link
Copy Markdown

Thanks @sethmlarson for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app

miss-islington-app Bot commented Jan 23, 2026

Copy link
Copy Markdown

Thanks @sethmlarson for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

All reactions

Sorry, something went wrong.

Uh oh!

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

@sethmlarson sethmlarson added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes and removed needs backport to 3.10 needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Jan 23, 2026
@miss-islington-app

miss-islington-app Bot commented Jan 23, 2026

Copy link
Copy Markdown

Thanks @sethmlarson for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington-app

miss-islington-app Bot commented Jan 23, 2026

Copy link
Copy Markdown

Thanks @sethmlarson for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@hugovk hugovk removed needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Jan 26, 2026
This was referenced Mar 13, 2026
CVE-2026-1299: debian package libpython3.13-stdlib-3.13.5-2 OpenHands/OpenHands-Cloud#348
Closed
CVE-2026-1299: debian package python3.13-minimal-3.13.5-2 OpenHands/OpenHands-Cloud#353
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bitdancer bitdancer bitdancer approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

stdlib Standard Library Python modules in the Lib/ directory topic-email type-security A security issue

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.

4 participants

@sethmlarson @bitdancer @hugovk @beledouxdenis
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.