Re: [Django] #36499: strip_tags() and test_parsing_errors() fails with patched Python versions due to HTMLParser EOF behavior change

27 views
Skip to first unread message

Django

unread,
Aug 7, 2025, 8:19:12 AM8/7/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: assigned
Component: Utilities | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Michał Górny):

This is now released in CPython 3.13.6, and it has been backported back as
far as to 3.9 (not released upstream yet, but at least some distributions
have already backported it).
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 7, 2025, 8:35:07 AM8/7/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: assigned
Component: Utilities | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia Bidart):

Replying to [comment:7 Michał Górny]:
> This is now released in CPython 3.13.6, and it has been backported back
as far as to 3.9 (not released upstream yet, but at least some
distributions have already backported it).

Thank you Michał! We are tracking Python releases and as soon as every
version is released upstream (3.13.6, 3.12.12, 3.11.14, 3.10.19 and
3.9.24), we'll update our CI workers and land my PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:8>

Django

unread,
Aug 12, 2025, 10:03:42 PM8/12/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: assigned
Component: Utilities | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin

Comment:

Code has been adjusted to work with versions of Python with and without
the fix. I'll set a reminder to clean the code up once all the Pythons are
released and available in out CI/CD.
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:9>

Django

unread,
Aug 12, 2025, 10:04:20 PM8/12/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by nessita <124304+nessita@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"2980627502c84a9fd09272e1349dc574a2ff1fb1" 29806275]:
{{{#!CommitTicketReference repository=""
revision="2980627502c84a9fd09272e1349dc574a2ff1fb1"
Fixed #36499 -- Adjusted
utils_tests.test_html.TestUtilsHtml.test_strip_tags following Python's
HTMLParser new behavior.

Python fixed a quadratic complexity processing for HTMLParser in:
https://github.com/python/cpython/commit/6eb6c5db.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:10>

Django

unread,
Aug 13, 2025, 4:48:48 PM8/13/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by nessita <124304+nessita@…>):

In [changeset:"74fafe2715fa2569a1682defcedc12a2e03b13d1" 74fafe2]:
{{{#!CommitTicketReference repository=""
revision="74fafe2715fa2569a1682defcedc12a2e03b13d1"
[5.2.x] Fixed test_utils.tests.HTMLEqualTests.test_parsing_errors
following Python's HTMLParser fixed parsing.

Further details about Python changes can be found in:
https://github.com/python/cpython/commit/0243f97cbadec8d985e63b1daec5d1cbc850cae3.

Refs #36499. Thank you Clifford Gama for the thorough review!

Backport of e4515dad7a6d953c0bd2414127ba36e1446ff41a from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:11>

Django

unread,
Aug 13, 2025, 4:48:48 PM8/13/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by nessita <124304+nessita@…>):

In [changeset:"9a720d5c5000b4fe0e75cdb87271065b5e80dedc" 9a720d5c]:
{{{#!CommitTicketReference repository=""
revision="9a720d5c5000b4fe0e75cdb87271065b5e80dedc"
[5.2.x] Fixed #36499 -- Adjusted
utils_tests.test_html.TestUtilsHtml.test_strip_tags following Python's
HTMLParser new behavior.

Python fixed a quadratic complexity processing for HTMLParser in:
https://github.com/python/cpython/commit/6eb6c5db.

Backport of 2980627502c84a9fd09272e1349dc574a2ff1fb1 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:12>

Django

unread,
Aug 13, 2025, 4:49:15 PM8/13/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by nessita <124304+nessita@…>):

In [changeset:"19e7b955520bfa78826c8e6c40b1756a39ba04b7" 19e7b95]:
{{{#!CommitTicketReference repository=""
revision="19e7b955520bfa78826c8e6c40b1756a39ba04b7"
[5.1.x] Fixed test_utils.tests.HTMLEqualTests.test_parsing_errors
following Python's HTMLParser fixed parsing.

Further details about Python changes can be found in:
https://github.com/python/cpython/commit/0243f97cbadec8d985e63b1daec5d1cbc850cae3.

Refs #36499. Thank you Clifford Gama for the thorough review!

Backport of e4515dad7a6d953c0bd2414127ba36e1446ff41a from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:13>

Django

unread,
Aug 13, 2025, 4:49:15 PM8/13/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by nessita <124304+nessita@…>):

In [changeset:"09801786df0f413e990a378f4603c8aeb16968cc" 0980178]:
{{{#!CommitTicketReference repository=""
revision="09801786df0f413e990a378f4603c8aeb16968cc"
[5.1.x] Fixed #36499 -- Adjusted
utils_tests.test_html.TestUtilsHtml.test_strip_tags following Python's
HTMLParser new behavior.

Python fixed a quadratic complexity processing for HTMLParser in:
https://github.com/python/cpython/commit/6eb6c5db.

Backport of 2980627502c84a9fd09272e1349dc574a2ff1fb1 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:14>

Django

unread,
Aug 13, 2025, 4:50:03 PM8/13/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by nessita <124304+nessita@…>):

In [changeset:"2a79837e19d2569c3e5162f3e0181a4e29bb7dba" 2a79837]:
{{{#!CommitTicketReference repository=""
revision="2a79837e19d2569c3e5162f3e0181a4e29bb7dba"
[4.2.x] Fixed test_utils.tests.HTMLEqualTests.test_parsing_errors
following Python's HTMLParser fixed parsing.

Further details about Python changes can be found in:
https://github.com/python/cpython/commit/0243f97cbadec8d985e63b1daec5d1cbc850cae3.

Refs #36499. Thank you Clifford Gama for the thorough review!

Backport of e4515dad7a6d953c0bd2414127ba36e1446ff41a from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:15>

Django

unread,
Aug 13, 2025, 4:50:03 PM8/13/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by nessita <124304+nessita@…>):

In [changeset:"c3f98718976820da5123169027612324d09a89d6" c3f98718]:
{{{#!CommitTicketReference repository=""
revision="c3f98718976820da5123169027612324d09a89d6"
[4.2.x] Fixed #36499 -- Adjusted
utils_tests.test_html.TestUtilsHtml.test_strip_tags following Python's
HTMLParser new behavior.

Python fixed a quadratic complexity processing for HTMLParser in:
https://github.com/python/cpython/commit/6eb6c5db.

Backport of 2980627502c84a9fd09272e1349dc574a2ff1fb1 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:16>

Django

unread,
Oct 22, 2025, 4:04:51 AM10/22/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by GitHub <noreply@…>):

In [changeset:"185b049e9e72a5ff4b07e33605e10eb4f52ca74c" 185b049e]:
{{{#!CommitTicketReference repository=""
revision="185b049e9e72a5ff4b07e33605e10eb4f52ca74c"
Refs #36499 -- Made TestUtilsHtml.test_strip_tags() assume behavior change
in X.Y.0 version for Python 3.14+.

This also removes unsupported versions of Python from the test dict.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:17>

Django

unread,
Dec 11, 2025, 11:28:59 AM12/11/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"7b80b2186300620931009fd62c2969f108fe7a62" 7b80b218]:
{{{#!CommitTicketReference repository=""
revision="7b80b2186300620931009fd62c2969f108fe7a62"
Refs #36499 -- Adjusted test_strip_tags following Python behavior change
for incomplete entities.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:18>

Django

unread,
Dec 11, 2025, 11:37:11 AM12/11/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"e5064f56a1815717a13b26a235168882966ef587" e5064f5]:
{{{#!CommitTicketReference repository=""
revision="e5064f56a1815717a13b26a235168882966ef587"
[6.0.x] Refs #36499 -- Adjusted test_strip_tags following Python behavior
change for incomplete entities.

Backport of 7b80b2186300620931009fd62c2969f108fe7a62 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:19>

Django

unread,
Dec 11, 2025, 11:38:48 AM12/11/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls <jacobtylerwalls@…>):

In [changeset:"5ca0f62213911a77dd4a62e843db7e420cc98b78" 5ca0f622]:
{{{#!CommitTicketReference repository=""
revision="5ca0f62213911a77dd4a62e843db7e420cc98b78"
[5.2.x] Refs #36499 -- Adjusted test_strip_tags following Python behavior
change for incomplete entities.

Backport of 7b80b2186300620931009fd62c2969f108fe7a62 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:20>

Django

unread,
Dec 31, 2025, 2:08:21 PM (2 days ago) 12/31/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Mike Dearman):

Just a heads up. I ran the Django test suite locally in my Ubuntu 24.04
Python 3.12.3 environment (sys.version showing as '3.12.3 (main, Nov 6
2025, 13:44:16) [GCC 13.3.0]') against the main Django branch
(d6ae2ed868e43671afc4d433c3d8f4d27f7eb555).

I am seeing two subtest failures in the test_strip_tags test.

{{{
FAIL: test_strip_tags
(utils_tests.test_html.TestUtilsHtml.test_strip_tags) [<object object at
0x75d20021d660>] (value='><!&&&&&&&&&&&&&&&&&&&&&&
...
======================================================================
FAIL: test_strip_tags
(utils_tests.test_html.TestUtilsHtml.test_strip_tags) [<object object at
0x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lib/python3.12/html/parser.py it appears to
contain the patch from
https://github.com/python/cpython/pull/135483/files.
The test_strip_tests changes from above seems to only consider 3.12.12+ as
having been patched based on the logic in
https://github.com/django/django/commit/7b80b2186300620931009fd62c2969f108fe7a62
#diff-8d44648c5c0191dee21c4d5034021573a885c878a9c50af658259c1747209f19R177

Based on https://launchpad.net/ubuntu/noble/+source/python3.12/+changelog
it seems that the libpython3.12-stdlib apt package was patched, but Python
still reports as 3.12.3, so the Django tests can't account for the patched
HTMLParser.

So others may experience this "issue", but not sure Django tests
can/should do anything different to account for it?
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:21>

Django

unread,
Dec 31, 2025, 3:12:51 PM (2 days ago) 12/31/25
to django-...@googlegroups.com
#36499: strip_tags() and test_parsing_errors() fails with patched Python versions
due to HTMLParser EOF behavior change
-------------------------------------+-------------------------------------
Reporter: MeggyCal | Owner: Natalia
Type: | Bidart
Cleanup/optimization | Status: closed
Component: Utilities | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jacob Walls):

Thanks for the info.

The version switches are left in for convenience for now, but we may
remove all of them as soon as all CI runners are running fully patched
Python versions, since Django doesn't officially support anything other
than the latest point releases of Python. You will encounter other test
failures (I think there is a recent mail-related ticket) if running
earlier point releases.
--
Ticket URL: <https://code.djangoproject.com/ticket/36499#comment:22>
Reply all
Reply to author
Forward
0 new messages