Only use custom subclass of HTMLParser for Python versions with buggy stdlib HTMLParser
|Reported by:||carljm||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Django currently has its own subclass of HTMLParser (in django.utils.html_parser.HTMLParser). It exists in order to patch a bug in the standard library's HTMLParser in Python 2.5 and older versions of 2.6 and 2.7. The bug has been fixed in Python 2.6.8, 2.7.3, and will be fixed in the upcoming 3.3 as well. There are also other fixes in 3.3's HTMLParser which conflict with the patched version in Django, since it relies on numerous undocumented internals.
For better forward-compatibility, we should only use our patched subclass for versions of Python known to contain the bug, and otherwise simply use the standard library's HTMLParser directly.
When we make this change, we can also roll back r17456, as that was simply papering over a breakage due to the modified HTMLParser in 2.6.8 and 2.7.3 - that will no longer be a problem if we don't try to use our subclass with those (and newer) Pythons.
Change History (9)
Changed 4 years ago by rhertzog
comment:3 Changed 4 years ago by rhertzog
- Has patch set
- Severity changed from Normal to Release blocker
comment:6 Changed 3 years ago by Claude Paroz <claude@…>
- Resolution set to fixed
- Status changed from new to closed