Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-143935: Email preserve parens when folding comments#143936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@sethmlarson
Copy link
Contributor

@sethmlarsonsethmlarson commentedJan 16, 2026
edited by bedevere-appbot
Loading

- No forced space to indent,- use almost the same code as the `bare-quoted-string`block above, handle nested comments and escaped parenthesisin addition
e.g. with a 40 characters length policy, the below`((loremipsum)(loremipsum)(loremipsum)(loremipsum))<spy@example.org>`should not be folded to`((loremipsum)(loremipsum)(loremipsum)\n(loremipsum))<spy@example.org>`but should rather stay`((loremipsum)(loremipsum)(loremipsum)(loremipsum))<spy@example.org>`to prevent to add a new line not starting with a space / with noindentation
To test a whitespace between two nested comments leads to anew line with one space indentation on folding
@sethmlarsonsethmlarsonforce-pushed theemail-preserve-parens-when-folding-comments branch from3a9b2c7 to8ad0fdbCompareJanuary 16, 2026 20:45
@sethmlarsonsethmlarson added type-securityA security issue stdlibStandard Library Python modules in the Lib/ directory topic-email labelsJan 16, 2026
@Yhg1sYhg1s added needs backport to 3.10only security fixes needs backport to 3.11only security fixes needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsJan 19, 2026
@Yhg1sYhg1senabled auto-merge (squash)January 19, 2026 12:15
@Yhg1sYhg1s merged commit17d1490 intopython:mainJan 19, 2026
50 checks passed
@miss-islington-app
Copy link

Thanks@sethmlarson for the PR, and@Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11, 3.12, 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 19, 2026
…H-143936)Fix a bug in the folding of comments when flattening an email messageusing a modern email policy. Comments consisting of a very long sequence ofnon-foldable characters could trigger a forced line wrap that omitted therequired leading space on the continuation line, causing the remainder ofthe comment to be interpreted as a new header field. This enabled headerinjection with carefully crafted inputs.(cherry picked from commit 17d1490aa97bd6b98a42b1a9b324ead84e7fd8a2)Co-authored-by: Seth Michael Larson <seth@python.org>Co-authored-by: Denis Ledoux <dle@odoo.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 19, 2026
…H-143936)Fix a bug in the folding of comments when flattening an email messageusing a modern email policy. Comments consisting of a very long sequence ofnon-foldable characters could trigger a forced line wrap that omitted therequired leading space on the continuation line, causing the remainder ofthe comment to be interpreted as a new header field. This enabled headerinjection with carefully crafted inputs.(cherry picked from commit17d1490)Co-authored-by: Seth Michael Larson <seth@python.org>Co-authored-by: Denis Ledoux <dle@odoo.com>
@bedevere-app
Copy link

GH-144034 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelJan 19, 2026
@bedevere-app
Copy link

GH-144036 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelJan 19, 2026
@bedevere-app
Copy link

GH-144037 is a backport of this pull request to the3.11 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.11only security fixes labelJan 19, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 19, 2026
…H-143936)Fix a bug in the folding of comments when flattening an email messageusing a modern email policy. Comments consisting of a very long sequence ofnon-foldable characters could trigger a forced line wrap that omitted therequired leading space on the continuation line, causing the remainder ofthe comment to be interpreted as a new header field. This enabled headerinjection with carefully crafted inputs.(cherry picked from commit17d1490)Co-authored-by: Seth Michael Larson <seth@python.org>Co-authored-by: Denis Ledoux <dle@odoo.com>
@sethmlarsonsethmlarson added needs backport to 3.11only security fixes needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsJan 19, 2026
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

Thanks@sethmlarson for the PR, and@Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 19, 2026
…H-143936)Fix a bug in the folding of comments when flattening an email messageusing a modern email policy. Comments consisting of a very long sequence ofnon-foldable characters could trigger a forced line wrap that omitted therequired leading space on the continuation line, causing the remainder ofthe comment to be interpreted as a new header field. This enabled headerinjection with carefully crafted inputs.(cherry picked from commit17d1490)Co-authored-by: Seth Michael Larson <seth@python.org>Co-authored-by: Denis Ledoux <dle@odoo.com>
@sethmlarsonsethmlarson removed needs backport to 3.11only security fixes needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsJan 19, 2026
@sethmlarsonsethmlarson deleted the email-preserve-parens-when-folding-comments branchJanuary 19, 2026 16:55
@miss-islington-app
Copy link

Sorry@sethmlarson and@Yhg1s, I had trouble completing the backport.
Please retry by removing and re-adding the "needs backport to 3.12" label.
Please backport backport usingcherry_picker on the command line.

cherry_picker 17d1490aa97bd6b98a42b1a9b324ead84e7fd8a2 3.12

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 19, 2026
…H-143936)Fix a bug in the folding of comments when flattening an email messageusing a modern email policy. Comments consisting of a very long sequence ofnon-foldable characters could trigger a forced line wrap that omitted therequired leading space on the continuation line, causing the remainder ofthe comment to be interpreted as a new header field. This enabled headerinjection with carefully crafted inputs.(cherry picked from commit17d1490)Co-authored-by: Seth Michael Larson <seth@python.org>Co-authored-by: Denis Ledoux <dle@odoo.com>
@miss-islington-app
Copy link

Sorry@sethmlarson and@Yhg1s, I had trouble completing the backport.
Please retry by removing and re-adding the "needs backport to 3.14" label.
Please backport backport usingcherry_picker on the command line.

cherry_picker 17d1490aa97bd6b98a42b1a9b324ead84e7fd8a2 3.14

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 19, 2026
…H-143936)Fix a bug in the folding of comments when flattening an email messageusing a modern email policy. Comments consisting of a very long sequence ofnon-foldable characters could trigger a forced line wrap that omitted therequired leading space on the continuation line, causing the remainder ofthe comment to be interpreted as a new header field. This enabled headerinjection with carefully crafted inputs.(cherry picked from commit17d1490)Co-authored-by: Seth Michael Larson <seth@python.org>Co-authored-by: Denis Ledoux <dle@odoo.com>
@miss-islington-app
Copy link

Sorry@sethmlarson and@Yhg1s, I had trouble completing the backport.
Please retry by removing and re-adding the "needs backport to 3.13" label.
Please backport backport usingcherry_picker on the command line.

cherry_picker 17d1490aa97bd6b98a42b1a9b324ead84e7fd8a2 3.13

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJan 19, 2026
…H-143936)Fix a bug in the folding of comments when flattening an email messageusing a modern email policy. Comments consisting of a very long sequence ofnon-foldable characters could trigger a forced line wrap that omitted therequired leading space on the continuation line, causing the remainder ofthe comment to be interpreted as a new header field. This enabled headerinjection with carefully crafted inputs.(cherry picked from commit17d1490)Co-authored-by: Seth Michael Larson <seth@python.org>Co-authored-by: Denis Ledoux <dle@odoo.com>
@miss-islington-app
Copy link

Sorry@sethmlarson and@Yhg1s, I had trouble completing the backport.
Please retry by removing and re-adding the "needs backport to 3.11" label.
Please backport backport usingcherry_picker on the command line.

cherry_picker 17d1490aa97bd6b98a42b1a9b324ead84e7fd8a2 3.11

pablogsal pushed a commit that referenced this pull requestJan 25, 2026
) (#144035)gh-143935: Email preserve parens when folding comments (GH-143936)Fix a bug in the folding of comments when flattening an email messageusing a modern email policy. Comments consisting of a very long sequence ofnon-foldable characters could trigger a forced line wrap that omitted therequired leading space on the continuation line, causing the remainder ofthe comment to be interpreted as a new header field. This enabled headerinjection with carefully crafted inputs.(cherry picked from commit17d1490)Co-authored-by: Seth Michael Larson <seth@python.org>Co-authored-by: Denis Ledoux <dle@odoo.com>
pablogsal pushed a commit that referenced this pull requestJan 25, 2026
) (#144037)gh-143935: Email preserve parens when folding comments (GH-143936)Fix a bug in the folding of comments when flattening an email messageusing a modern email policy. Comments consisting of a very long sequence ofnon-foldable characters could trigger a forced line wrap that omitted therequired leading space on the continuation line, causing the remainder ofthe comment to be interpreted as a new header field. This enabled headerinjection with carefully crafted inputs.(cherry picked from commit17d1490)Co-authored-by: Seth Michael Larson <seth@python.org>Co-authored-by: Denis Ledoux <dle@odoo.com>
pablogsal pushed a commit that referenced this pull requestJan 25, 2026
) (#144034)Co-authored-by: Seth Michael Larson <seth@python.org>Co-authored-by: Denis Ledoux <dle@odoo.com>
pablogsal pushed a commit that referenced this pull requestJan 26, 2026
) (#144036)Co-authored-by: Seth Michael Larson <seth@python.org>Co-authored-by: Denis Ledoux <dle@odoo.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@bitdancerbitdancerbitdancer approved these changes

Assignees

@Yhg1sYhg1s

Labels

needs backport to 3.10only security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-emailtype-securityA security issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@sethmlarson@bitdancer@Yhg1s@beledouxdenis

[8]ページ先頭

©2009-2026 Movatter.jp