[Python-bugs-list] [ python-Bugs-699079 ] HTMLParser crash on glued tag attributes

SourceForge.net noreply@sourceforge.net
Mon, 09 Jun 2003 13:00:11 -0700


Bugs item #699079, was opened at 2003-03-07 00:49
Message generated for change (Comment added) made by adsr
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=699079&group_id=5470

Category: Python Library
>Group: Not a Bug
>Status: Closed
>Resolution: Wont Fix
Priority: 1
Submitted By: Artur de Sousa Rocha (adsr)
Assigned to: Nobody/Anonymous (nobody)
Summary: HTMLParser crash on glued tag attributes

Initial Comment:
HTMLParser.HTMLParser and derived classes crash when
two tag attributes are glued like:

WIDTH="512"HEIGHT="83"

Example from IDLE:

>>> import HTMLParser
>>> BUGTEXT = """
<table CELLSPACING="0" CELLPADDING="0" BORDER="0"
WIDTH="100%">
<tr><td align="center">
<table CELLSPACING="0" CELLPADDING="0" BORDER="0"
WIDTH="600" BGCOLOR="white">
<tr><td WIDTH="512">
<img SRC="/pict/img83.jpg" WIDTH="512"HEIGHT="83"
BORDER="0" VSPACE="0" HSPACE="0">
</td><td WIDTH="2"></td>
</tr></table></td></tr></table>
"""
>>> parser = HTMLParser.HTMLParser()
>>> parser.feed(BUGTEXT)
>>> parser.close()
Traceback (most recent call last):
  File "<pyshell#19>", line 1, in ?
    parser.close()
  File "C:\Python22\lib\HTMLParser.py", line 112, in close
    self.goahead(1)
  File "C:\Python22\lib\HTMLParser.py", line 166, in
goahead
    self.error("EOF in middle of construct")
  File "C:\Python22\lib\HTMLParser.py", line 115, in error
    raise HTMLParseError(message, self.getpos())
HTMLParseError: EOF in middle of construct, at line 6,
column 1


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

>Comment By: Artur de Sousa Rocha (adsr)
Date: 2003-06-09 22:00

Message:
Logged In: YES 
user_id=728207

I agree with bcannon. Tagging as "Not a bug".

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

Comment By: Brett Cannon (bcannon)
Date: 2003-06-08 23:18

Message:
Logged In: YES 
user_id=357491

Raising an exception for this seems reasonable to me.  It is not 
valid HTML or XML to my knowledge so I don't see the problem 
here.  If there still is one please enlighten me.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=699079&group_id=5470