This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: HTMLParser crash on glued tag attributes
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: adsr, brett.cannon
Priority: low Keywords:

Created on 2003-03-06 23:49 by adsr, last changed 2022-04-10 16:07 by admin. This issue is now closed.

Messages (3)
msg15005 - (view) Author: Artur de Sousa Rocha (adsr) Date: 2003-03-06 23:49
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
msg15006 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-06-08 21:18
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.
msg15007 - (view) Author: Artur de Sousa Rocha (adsr) Date: 2003-06-09 20:00
Logged In: YES 
user_id=728207

I agree with bcannon. Tagging as "Not a bug".
History
Date User Action Args
2022-04-10 16:07:26adminsetgithub: 38119
2003-03-06 23:49:32adsrcreate