Skip to content

lxml 6.0.0 changes rendering of email templates #18370

@miketheman

Description

@miketheman

lxml 6.0.0 was released on 2025-06-26.
Refs: https://lxml.de/6.0/changes-6.0.0.html

Updating to this version and executing the test suite will surface failures across tests/unit/email/test_init.py tests.

Two things stand out:

  • Rendering EventTag.Account.EmailSent changes
  • The HTML body has one <p> tag removed

Examples of the changes:

before 6.0.0:

... {'tag': 'account:email:sent', 'user_id': 'id_1' ...

... 'body_html': '<html>\n<head></head>\n<body><p>Email HTML Body</p></body>\n</html>\n' ...

after 6.0.0:

... {'tag': <Account.EmailSent: 'account:email:sent'>, 'user_id': 'id_1' ...

... 'body_html': '<html>\n<head></head>\n<body>Email HTML Body</body>\n</html>\n', ...

It's not super clear why this changed this way, and what the smallest, clearest corrective action is.

The task is to understand what changed in lxml 6.0.0 and what changes drove these behavioral changes, and submit a pull request updating lxml version and updates to the codebase, and share those details in the pull request description.

To only run the email tests, this command helps:

T=tests/unit/email/test_init.py make tests

This test command isolates a single test to expose the issue more clearly:

T=tests/unit/email/test_init.py::TestRemovedReleaseFileEmail::test_send_removed_project_release_file_email_to_maintainer TESTARGS="-vvv -n0 -p no:sugar" make tests

Good First Issue: This issue is good for first time contributors. If you've already contributed to Warehouse, work on another issue without this label instead. If there is not a corresponding pull request for this issue, it is up for grabs. For directions for getting set up, see our Getting Started Guide.

If you are working on this issue and have questions, feel free to ask them here, in the #pypa-dev chat channel on Libera, the PyPA Discord or on the Discourse.

Screenshot Required: If your pull request makes a visual change, include a screenshot of your update. This helps our team give you feedback faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency filegood first issueThis issue is ideal for first-time contributors!pythonPull requests that update Python code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions