Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#26922 closed Bug (fixed)

AttributeError in assert_and_parse_html on Python 3.5+

Reported by: Dmitry Dygalo Owned by: Dmitry Dygalo
Component: Testing framework Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I got this on Django 1.9 with Python 3.5:

    def assert_and_parse_html(self, html, user_msg, msg):
        try:
            dom = parse_html(html)
        except HTMLParseError as e:
>           standardMsg = '%s\n%s' % (msg, e.msg)
E           AttributeError: 'HTMLParseError' object has no attribute 'msg'

As I see it happens when input HTML is not valid (I tried with "< div></ div>")

PR: https://github.com/django/django/pull/6943

Change History (4)

comment:1 by Dmitry Dygalo, 8 years ago

Owner: changed from nobody to Dmitry Dygalo
Status: newassigned

comment:2 by Tim Graham, 8 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In d7a09726:

Fixed #26922 -- Fixed SimpleTestCase.assertHTMLEqual() crash on Python 3.5+.

comment:4 by Tim Graham <timograham@…>, 8 years ago

In b3f96b5f:

[1.10.x] Fixed #26922 -- Fixed SimpleTestCase.assertHTMLEqual() crash on Python 3.5+.

Backport of d7a097265b1842843a73ce0da36ef98bacac8a3e from master

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