bpo-33972: Fix EmailMessage.iter_attachments raising AttributeError. by maxking · Pull Request #14119 · python/cpython

@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.

@maxking

mangrisano

warsaw

@maxking

@maxking

maxking added a commit to maxking/cpython-1 that referenced this pull request

Jun 25, 2019
…rror. (pythonGH-14119)

* bpo-33972: Fix EmailMessage.iter_attachments raising AttributeError.

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>

maxking added a commit to maxking/cpython-1 that referenced this pull request

Jun 25, 2019
…rror. (pythonGH-14119)

* bpo-33972: Fix EmailMessage.iter_attachments raising AttributeError.

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>

miss-islington pushed a commit that referenced this pull request

Jun 25, 2019
…rror (GH-14119) (GH-14380)

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

miss-islington pushed a commit that referenced this pull request

Jun 25, 2019
…rror. (GH-14119) (GH-14381)

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

lisroach pushed a commit to lisroach/cpython that referenced this pull request

Sep 10, 2019
…ythonGH-14119)

* bpo-33972: Fix EmailMessage.iter_attachments raising AttributeError.

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.

DinoV pushed a commit to DinoV/cpython that referenced this pull request

Jan 14, 2020
…ythonGH-14119)

* bpo-33972: Fix EmailMessage.iter_attachments raising AttributeError.

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.