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

[3.8] gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233)#122611

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
ambv merged 4 commits intopython:3.8fromambv:backport-0976339-3.8
Sep 4, 2024

Conversation

ambv
Copy link
Contributor

@ambvambv commentedAug 2, 2024
edited by bedevere-appbot
Loading

Per RFC 2047:

[...] these encoding schemes allow the
encoding of arbitrary octet values, mail readers that implement this
decoding should also ensure that display of the decoded data on the
recipient's terminal will not cause unwanted side-effects

It seems that the "quoted-word" scheme is a valid way to include a newline character in a header value, just like we already allow undecodable bytes or control characters.
They do need to be properly quoted when serialized to text, though.

This should fail for custom fold() implementations that aren't careful about newlines.

(cherry picked from commit0976339)

… are sound (pythonGH-122233)Per RFC 2047:> [...] these encoding schemes allow the> encoding of arbitrary octet values, mail readers that implement this> decoding should also ensure that display of the decoded data on the> recipient's terminal will not cause unwanted side-effectsIt seems that the "quoted-word" scheme is a valid way to includea newline character in a header value, just like we already allowundecodable bytes or control characters.They do need to be properly quoted when serialized to text, though.This should fail for custom fold() implementations that aren't carefulabout newlines.(cherry picked from commit0976339)Co-authored-by: Petr Viktorin <encukou@gmail.com>Co-authored-by: Bas Bloemsaat <bas@bloemsaat.org>Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@vstinner
Copy link
Member

Sadly, the build fails on macOS:

checking for gcc... clangchecking whether the C compiler works... noconfigure: error: in `/Users/runner/work/cpython/cpython':configure: error: C compiler cannot create executablesSee `config.log' for more details

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM: straightforward backport and the change is properly documented as.. versionadded:: 3.8.20 with "Notable changes in 3.8.20" in What's New in Python 3.8. I compared this 3.8 change to the change in the main branch.

@ambvambv merged commitb158a76 intopython:3.8Sep 4, 2024
13 of 14 checks passed
@ambvambv deleted the backport-0976339-3.8 branchSeptember 4, 2024 15:39
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vstinnervstinnervstinner approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@ambv@vstinner@encukou

[8]ページ先頭

©2009-2025 Movatter.jp