Skip to content

gh-118718: Incorrect decoding of preamble in email parser #134384

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

GGyll
Copy link
Contributor

@GGyll GGyll commented May 20, 2025

When parsing raw binary MIME message where the preamble contains UTF-8 encoded data

It seems we've found an issue with the email.parser module when parsing raw binary MIME message where the preamble contains UTF-8 encoded data

By checking if the parser policy utf-8 attribute is present and True we use that instead of falling back to the hardcoded "ascii" encoding on the TextIOWrapper.

@GGyll
Copy link
Contributor Author

GGyll commented Jun 2, 2025

@bitdancer @gpshead could you please review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant