GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_email: `content-shadow` header tuple is discarded in `test_message.py` · Issue #161479 · python/cpython

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

New issue
Copy link
New issue
Copy link
Open
#161480
Open
test_email: content-shadow header tuple is discarded in test_message.py#161479
#161480
Copy link
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-emailtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@PavlNekrasov
PavlNekrasov
opened on Nov 6, 2026
Issue body actions

Bug report

cpython/Lib/test/test_email/test_message.py

Lines 584 to 585 in 288cc2b

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:

cpython/Lib/test/test_email/test_message.py

Lines 616 to 619 in 288cc2b

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

  • gh-161479: Fix discarded header tuple in test_email test_message #161480

Activity

  1. PavlNekrasov
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Nov 6, 2026
  2. NekoAsakura
    added
    testsTests in the Lib/test dirTests in the Lib/test dir
    topic-email
    on Nov 6, 2026
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 dirTests in the Lib/test dirtopic-emailtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.