[3.8] bpo-33972: Fix EmailMessage.iter_attachments raising AttributeError (GH-14119) by maxking · Pull Request #14380 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation2 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

maxking

When certain malformed messages have content-type set to 'mulitpart/*' but
still have a single part body, iter_attachments can raise AttributeError. This
patch fixes it by returning a None value instead when the body is single part.
(cherry picked from commit 0225701)

Co-authored-by: Abhilash Raj maxking@users.noreply.github.com

https://bugs.python.org/issue33972

@maxking

…rror. (pythonGH-14119)

When certain malformed messages have content-type set to 'mulitpart/*' but still have a single part body, iter_attachments can raise AttributeError. This patch fixes it by returning a None value instead when the body is single part. (cherry picked from commit 0225701)

Co-authored-by: Abhilash Raj maxking@users.noreply.github.com

warsaw

@miss-islington

@maxking: Status check is done, and it's a success ✅ .

@darraghenright

Hi there 👋 What version of 3.8 did this get merged into? Can't seem to see that. Thanks!

Edit — wait, I think it's 3.8.0 beta 2. Interesting, I'm running 3.8.2 and I think I came across this. Will investigate to make sure.

Labels

type-bug

An unexpected behavior, bug, or error