Skip to content

test_email: content-shadow header tuple is discarded in test_message.py #161479

Description

@PavlNekrasov

Bug report

if subtype != 'no_content':
('content-shadow', 'Logrus'),

The tuple is created and immediately discarded, so content-shadow never ends
up in msg_headers and the check that non-standard content-* headers (other
than Content-Type) are copied to the part in _check_make_multipart never
runs:

for name, value in msg_headers:
if name.lower().startswith('content-'):
self.assertEqual(part[name], value)
count += 1

The mistake masks a real regression: if the condition in Lib/email/message.py
is narrowed to Content-Type only, the current test set stays green (307 OK),
while with the content-shadow header properly appended 36 tests fail.

Found by Linux Verification Center (linuxtesting.org) with SVACE

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtopic-emailtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions