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 — Fix ElementTree serialization to HTML · Issue #149489 · python/cpython

Fix ElementTree serialization to HTML #149489

New issue
Copy link
New issue
Copy link
Closed
Closed
Fix ElementTree serialization to HTML#149489
Copy link
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-XMLtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@serhiy-storchaka
serhiy-storchaka
opened on May 7, 2026
Issue body actions

Bug report

There are several bugs which prevent generation of correct HTML:

  • Comment and "processing instruction" content should not be escaped. Similar bug was fixed for XML in ElementTree ProcessingInstruction uses character entities in content #46995.
  • There are more elements besides <script> and <style> whose content should not be escaped.
  • <plaintext> does not have the closing tag, and its content should not be escaped.
  • Empty attributes (with value None) are not supported.

Linked PRs

  • gh-149489: Fix ElementTree serialization to HTML #149490
  • [3.15] gh-149489: Fix ElementTree serialization to HTML (GH-149490) #150592
  • [3.14] gh-149489: Fix ElementTree serialization to HTML (GH-149490) #150593
  • [3.13] gh-149489: Fix ElementTree serialization to HTML (GH-149490) #150594
  • [3.15] gh-149489: Fix ElementTree serialization to HTML (GH-149490) #150595
  • [3.14] gh-149489: Fix ElementTree serialization to HTML (GH-149490) #150596
  • [3.13] gh-149489: Fix ElementTree serialization to HTML (GH-149490) (GH-150596) #150609

Activity

  1. serhiy-storchaka
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    topic-XML
    3.13only security fixesonly security fixes
    3.14bugs and security fixesbugs and security fixes
    on May 7, 2026
  2. serhiy-storchaka commented on May 7, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on May 7, 2026
    MemberAuthor
    More actions

    There is a question what to do with <noscript>. It's syntax depends on whether scripting was enabled.

  3. serhiy-storchaka commented on May 7, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on May 7, 2026
    MemberAuthor
    More actions

    Well, it is only issue for the parser. The generator should escape it's content, and allow subelements.

  4. serhiy-storchaka
    added a commit that references this issue on May 7, 2026

    pythongh-149489: Fix ElementTree serialization to HTML

    e41d61c
  5. serhiy-storchaka
    added
    3.15bugs and security fixesbugs and security fixes
    on May 8, 2026
  6. serhiy-storchaka
    added a commit that references this issue on May 29, 2026

    gh-149489: Fix ElementTree serialization to HTML (GH-149490)

    bcd29e4
  7. miss-islington
    added 2 commits that reference this issue on May 29, 2026

    pythongh-149489: Fix ElementTree serialization to HTML (pythonGH-149490)

    26f9c5f

    pythongh-149489: Fix ElementTree serialization to HTML (pythonGH-149490)

    6efc3f3
  8. serhiy-storchaka
    added 3 commits that reference this issue on May 29, 2026

    [3.15] gh-149489: Fix ElementTree serialization to HTML (GH-149490) (G…

    2f91315

    [3.14] pythongh-149489: Fix ElementTree serialization to HTML (python…

    de5e730

    [3.14] pythongh-149489: Fix ElementTree serialization to HTML (python…

    f596830
  9. serhiy-storchaka commented on May 29, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on May 29, 2026
    MemberAuthor
    More actions

    Stopping escaping comments and "processing instruction" can create security issue if users were not ready for this, so it is not safe to backport this to released versions. Support of empty attributes looks rather like a new feature. But I think that the rest of changes are safe for backporting.

  10. serhiy-storchaka
    added 2 commits that reference this issue on May 30, 2026

    [3.14] gh-149489: Fix ElementTree serialization to HTML (GH-149490) (G…

    c42e6d3

    [3.13] gh-149489: Fix ElementTree serialization to HTML (GH-149490) (G…

    b46df7f
  11. serhiy-storchaka
    closed this as completedon Jun 10, 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

    3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-XMLtype-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.