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-134152: Fix UnboundLocalError in email._header_value_parser _get_ptext_to_endchars#134233

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

Merged

Conversation

bitdancer
Copy link
Member

@bitdancerbitdancer commentedMay 19, 2025
edited by bedevere-appbot
Loading

Fix an UnboundLocalError that can occur when parsing certain delimited constructs in headers (domain literals, quoted strings, comments). After the fix the _get_ptext_to_endchars returns an empty string if there is no content after the opening delimiter. The calling code is responsible for handling the lack of the trailing delimiter, which it already does; this edge case was the header ending immediately after the opening delimiter.

Most of these tests currently pass, where the content is simply empty.Three of them fail, where none of the ending delimiters are found.
@bitdancerbitdancer merged commita32ea45 intopython:mainMay 25, 2025
43 checks passed
@bitdancerbitdancer added awaiting merge needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsMay 25, 2025
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 25, 2025
…_get_ptext_to_endchars (pythonGH-134233)Fix an UnboundLocalError that can occur when parsing certain delimited constructs in headers (domain literals, quoted strings, comments). After the fix the _get_ptext_to_endchars returns an empty string if there is no content after the opening delimiter. The calling code is responsible for handling the lack of the trailing delimiter, which it already does; this edge case was the header ending immediately after the opening delimiter.(cherry picked from commita32ea45)Co-authored-by: R. David Murray <rdmurray@bitdance.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 25, 2025
…_get_ptext_to_endchars (pythonGH-134233)Fix an UnboundLocalError that can occur when parsing certain delimited constructs in headers (domain literals, quoted strings, comments). After the fix the _get_ptext_to_endchars returns an empty string if there is no content after the opening delimiter. The calling code is responsible for handling the lack of the trailing delimiter, which it already does; this edge case was the header ending immediately after the opening delimiter.(cherry picked from commita32ea45)Co-authored-by: R. David Murray <rdmurray@bitdance.com>
@bedevere-app
Copy link

GH-134677 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelMay 25, 2025
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelMay 25, 2025
hugovk pushed a commit that referenced this pull requestMay 26, 2025
… _get_ptext_to_endchars (GH-134233) (#134678)Co-authored-by: R. David Murray <rdmurray@bitdance.com>
hugovk pushed a commit that referenced this pull requestMay 26, 2025
… _get_ptext_to_endchars (GH-134233) (#134677)Co-authored-by: R. David Murray <rdmurray@bitdance.com>
@bitdancerbitdancer deleted the get_ptext_to_endchars_pos_error branchMay 26, 2025 16:55
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gpsheadgpsheadgpshead approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@bitdancer@gpshead

[8]ページ先頭

©2009-2025 Movatter.jp