Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.13] gh-135661: Fix CDATA section parsing in HTMLParser (GH-135665)#137773

Merged
serhiy-storchaka merged 1 commit intopython:3.13python/cpython:3.13from
miss-islington:backport-0cbbfc4-3.13miss-islington/cpython:backport-0cbbfc4-3.13Copy head branch name to clipboard
Aug 14, 2025
Merged

[3.13] gh-135661: Fix CDATA section parsing in HTMLParser (GH-135665)#137773
serhiy-storchaka merged 1 commit intopython:3.13python/cpython:3.13from
miss-islington:backport-0cbbfc4-3.13miss-islington/cpython:backport-0cbbfc4-3.13Copy head branch name to clipboard

Conversation

@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Aug 14, 2025

"] ]>" and "]] >" no longer end the CDATA section.

Make CDATA section parsing context depending.
Add private method HTMLParser._set_support_cdata() to change the context.
If called with True, "<[CDATA[" starts a CDATA section which ends with "]]>".
If called with False, "<[CDATA[" starts a bogus comments which ends with ">".
(cherry picked from commit 0cbbfc4)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

…5665)

"] ]>" and "]] >" no longer end the CDATA section.

Make CDATA section parsing  context depending.
Add private method HTMLParser._set_support_cdata() to change the context.
If called with True, "<[CDATA[" starts a CDATA section which ends with "]]>".
If called with False, "<[CDATA[" starts a bogus comments which ends with ">".
(cherry picked from commit 0cbbfc4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchaka serhiy-storchaka merged commit a335967 into python:3.13 Aug 14, 2025
44 checks passed
@miss-islington miss-islington deleted the backport-0cbbfc4-3.13 branch January 2, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-security A security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.