Opened 12 years ago

Closed 12 years ago

#19148 closed Bug (fixed)

regressiontests.test_utils.tests.HTMLEqualTests.test_parse_html_in_script() fails with Python 2.6.8

Reported by: Arfrever Owned by: nobody
Component: Core (Other) Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

regressiontests.test_utils.tests.HTMLEqualTests.test_parse_html_in_script() fails with Python 2.6.8 in Django 1.4.2. This test passed in Django 1.4.1.

======================================================================
ERROR: test_parse_html_in_script (regressiontests.test_utils.tests.HTMLEqualTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/Django-1.4.2/tests/regressiontests/test_utils/tests.py", line 224, in test_parse_html_in_script
    ''')
  File "/tmp/Django-1.4.2/django/test/html.py", line 213, in parse_html
    parser.feed(html)
  File "/usr/lib64/python2.6/HTMLParser.py", line 108, in feed
    self.goahead(0)
  File "/usr/lib64/python2.6/HTMLParser.py", line 150, in goahead
    k = self.parse_endtag(i)
  File "/usr/lib64/python2.6/HTMLParser.py", line 319, in parse_endtag
    self.handle_endtag(tag.lower())
  File "/tmp/Django-1.4.2/django/test/html.py", line 191, in handle_endtag
    tag, self.format_position()))
  File "/tmp/Django-1.4.2/django/test/html.py", line 153, in error
    raise HTMLParseError(msg, self.getpos())
HTMLParseError: Unexpected end tag `p` (Line 3, Column 35), at line 3, column 36

----------------------------------------------------------------------

Change History (2)

comment:1 by Claude Paroz, 12 years ago

Component: UncategorizedCore (Other)
Triage Stage: UnreviewedReady for checkin
Type: UncategorizedBug

Right, we forgot to backport [fcec904e4f35]. See also #18239.

comment:2 by Claude Paroz <claude@…>, 12 years ago

Resolution: fixed
Status: newclosed

In ce168bb8994b0a7e032166e63a8b1cec034694d6:

[1.4.x] Fix an HTML-parser test that's failed in Python 2.6.8 since 5c79dd58.

The problem description in #18239 asserted that
http://bugs.python.org/issue670664 was fixed in Python 2.6.8, but based on
http://bugs.python.org/issue670664#msg146770 it appears that's not correct; the
fix was only applied in 2.7, 3.2, and Python trunk. Therefore we must use our
patched HTMLParser subclass in all Python 2.6 versions.

Backport of fcec904e4f from master. Fixes #19148.

Note: See TracTickets for help on using tickets.
Back to Top