mirror of
https://github.com/python/cpython.git
synced 2025-11-11 19:12:05 +00:00
[3.11] gh-106186: Don't report MultipartInvariantViolationDefect for valid multipart emails when parsing header only (GH-107016) (#107112)
(cherry picked from commit c65592c4d6)
Co-authored-by: htsedebenham <31847376+htsedebenham@users.noreply.github.com>
This commit is contained in:
parent
d2cdf0888b
commit
afa24d52b8
4 changed files with 28 additions and 1 deletions
|
|
@ -189,7 +189,7 @@ def close(self):
|
|||
assert not self._msgstack
|
||||
# Look for final set of defects
|
||||
if root.get_content_maintype() == 'multipart' \
|
||||
and not root.is_multipart():
|
||||
and not root.is_multipart() and not self._headersonly:
|
||||
defect = errors.MultipartInvariantViolationDefect()
|
||||
self.policy.handle_defect(root, defect)
|
||||
return root
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue