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.

Author ezust
Recipients
Date 2004-11-09.16:54:37
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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.
History
Date User Action Args
2007-08-23 14:27:21adminlinkissue1063229 messages
2007-08-23 14:27:21admincreate