]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-135661: Fix abrupt closing of empty comment in HTMLParser (GH-153007) ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 4 Jul 2026 12:32:20 +0000 (14:32 +0200)
committerGitHub <noreply@github.com>
Sat, 4 Jul 2026 12:32:20 +0000 (12:32 +0000)
commitc3c710fdb199157435e8874ed07e438f9ab784fc
tree6b7994a6351640bd95d0b92c469a7521995f9e30
parentd786fbdfcc9d63e0f92df60f464c46ac6b4ce292
[3.14] gh-135661: Fix abrupt closing of empty comment in HTMLParser (GH-153007) (GH-153025)

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.
(cherry picked from commit ed370d3337c1ac4f7295b444a4807c0b72287608)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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]