[ python-Bugs-1063229 ] not enough information in SGMLParserError?

SourceForge.net noreply at sourceforge.net
Tue Nov 9 17:54:37 CET 2004


Bugs item #1063229, was opened at 2004-11-09 11:54
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1063229&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Alan Ezust (ezust)
Assigned to: Nobody/Anonymous (nobody)
Summary: not enough information in SGMLParserError?

Initial Comment:
When SGMLParser encounters a badly formed webpage, it
throws sgmllib.SGMLParseError with a cryptic message:

[bin] > python sgmlparsertest.py
Pythonlib's error message: expected name token

I think it should give the line and offset, and maybe
even the text it had problems with, in the args of the
exception. And print it out in the message. 

My extra information: error at line 1 offset 2
<head>
 ^
[bin] 

I tried to print it out by using parser.getpos() but it
returns values which do not correspond to the error.
How do I determine this at runtime?

testcase that reproduces this problem attached.


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

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


More information about the Python-bugs-list mailing list