Bugs item #761452, was opened at 2003-06-26 23:11 Message generated for change (Comment added) made by birkenfeld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=761452&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: Python 2.2.3 >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Robert Walsh (rjwalsh) Assigned to: Fred L. Drake, Jr. (fdrake) Summary: HTMLParser chokes on my.yahoo.com output Initial Comment: The HTML parser chokes on the output produced by http://my.yahoo.com/. The problem appears to be that the HTML Yahoo is producing contains stuff like this: <option foo bar=> The bar= without any value causes HTMLParser to get confused. I made the following patch to HTMLParser.py and everything is now happy. This may be illegal HTML, but it appears to be popular. Basically, this patch tells it that the part after the = is optional. --- HTMLParser.py.orig 2003-06-26 14:05:07.670049324 -0700 +++ HTMLParser.py 2003-06-26 14:05:14.440298260 -0700 @@ -36,7 +36,7 @@ (?:'[^']*' # LITA-enclosed value |\"[^\"]*\" # LIT-enclosed value |[^'\">\s]+ # bare value - ) + )? )? ) )* ---------------------------------------------------------------------- >Comment By: Reinhold Birkenfeld (birkenfeld) Date: 2005-09-01 00:09 Message: Logged In: YES user_id=1188172 Checked in as Lib/HTMLParser.py r1.16, 1.15.2.1. ---------------------------------------------------------------------- Comment By: Robert Walsh (rjwalsh) Date: 2005-06-01 22:52 Message: Logged In: YES user_id=608672 Crap. Stupid SourceForge bug tracker puts the latest stuff on top - I was replying to the wrong one. The change can be applied, in my opinion. ---------------------------------------------------------------------- Comment By: Robert Walsh (rjwalsh) Date: 2005-06-01 22:51 Message: Logged In: YES user_id=608672 It's been so long since I looked at this, I don't believe I even have the code any more. It's just a one-character change, though - can you recreate it yourself by just adding the ? character to the end of line 39 in HTMLParser.py. Unless it's moved in the meantime, of course. ---------------------------------------------------------------------- Comment By: Reinhold Birkenfeld (birkenfeld) Date: 2005-06-01 14:24 Message: Logged In: YES user_id=1188172 Should it be applied, then? ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2003-06-30 17:49 Message: Logged In: YES user_id=6380 Here it is (a one-char change). Looks harmless to me. ---------------------------------------------------------------------- Comment By: Neal Norwitz (nnorwitz) Date: 2003-06-27 04:55 Message: Logged In: YES user_id=33168 It's difficult to read the patch as posted since whitespace is lost. Please attach the patch as a file. Thanks. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=761452&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com