]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-135661: Fix abrupt closing of empty comment in HTMLParser (GH-153007)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 4 Jul 2026 12:05:07 +0000 (15:05 +0300)
committerGitHub <noreply@github.com>
Sat, 4 Jul 2026 12:05:07 +0000 (15:05 +0300)
commited370d3337c1ac4f7295b444a4807c0b72287608
tree759a3fcbfa8df01accea9b321072fe2f268a8bbf
parentcfe3e07f546d84b04ae2cab4dc464701d610dd02
gh-135661: Fix abrupt closing of empty comment in HTMLParser (GH-153007)

An abruptly closed empty comment ("<!-->" or "<!--->") no longer extends
up to a later "-->" in the same feed() call.

test_htmlparser now also feeds each string source as a single chunk, in
addition to one character at a time, to exercise different input buffering.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/html/parser.py
Lib/test/test_htmlparser.py
Misc/NEWS.d/next/Library/2026-07-04-13-00-00.gh-issue-135661.CIkADG.rst [new file with mode: 0644]