Skip to content

iterparse: ignore strip_cdata with HTML#450

Merged
scoder merged 1 commit intolxml:masterfrom
ferdnyc:iterparse-strip_cdata
Feb 3, 2025
Merged

iterparse: ignore strip_cdata with HTML#450
scoder merged 1 commit intolxml:masterfrom
ferdnyc:iterparse-strip_cdata

Conversation

@ferdnyc
Copy link
Copy Markdown
Contributor

@ferdnyc ferdnyc commented Feb 3, 2025

Commit b79424c deprecated the strip_cdata argument to the HTML parser, causing all uses of iterparse() to trigger its DeprecationWarning (due to the default True value). Remove the strip_cdata argument from the HTML parser's arguments, and document it as ignored in iterparse() except for XML documents.

Tests are added to test_htmlparser.py, I've verified that they fail on the master branch without this change, but pass on the PR branch.

See also: https://bugs.launchpad.net/lxml/+bug/2067707

Commit b79424c deprecated the strip_cdata argument to the HTML
parser, causing all uses of iterparse() to trigger its
DeprecationWarning (due to the default True value). Remove the
strip_cdata argument from the HTML parser's arguments, and
document it as ignored in iterparse() except for XML documents.
@scoder scoder merged commit c7a9da7 into lxml:master Feb 3, 2025
@scoder
Copy link
Copy Markdown
Member

scoder commented Feb 3, 2025

Thanks. I'll release a 5.3.1 soon that should include this fix.

scoder pushed a commit that referenced this pull request Feb 3, 2025
Commit b79424c
deprecated the strip_cdata argument to the HTML parser, causing all uses of iterparse()
to trigger its DeprecationWarning (due to the default True value).

Remove the strip_cdata argument from the HTML parser's arguments,
and document it as ignored in iterparse() except for XML documents.

See https://bugs.launchpad.net/lxml/+bug/2067707
@ferdnyc ferdnyc deleted the iterparse-strip_cdata branch February 3, 2025 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants